Skip to content

Commit ff0e534

Browse files
committed
v1.2.4 (Aurimus_)
1 parent 2d8b1ef commit ff0e534

File tree

1 file changed

+52
-8
lines changed

1 file changed

+52
-8
lines changed

KazTron.py

+52-8
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
client = commands.Bot(command_prefix='.', description='This an automated bot for r/worldbuilding discord server', pm_help= True)
1616
Client = discord.Client()
17-
version = "v1.2.1"
18-
Changelog = "-Bug fixes and minor changes to the spotlight command. \n"
17+
version = "v1.2.4"
18+
Changelog = "- .wb command tweaked"
1919
manual = "https://github.com/Kazandaki/KazTron/wiki"
2020
github = "https://github.com/Kazandaki/KazTron"
2121
roadmap = "https://docs.google.com/spreadsheets/d/1ScVRoondp50HoonVBTZz8WUmfkLnDlGaomJrG0pgGs0/edit?usp=sharing"
@@ -36,7 +36,7 @@
3636

3737
@client.event
3838
async def on_ready():
39-
await client.change_presence(game=discord.Game(name='with the fate of humanity'))
39+
await client.change_presence(game=discord.Game(name='Ew people'))
4040
print('\n')
4141
print('Logged in as')
4242
print(client.user.name)
@@ -279,12 +279,12 @@ async def spotlight(ctx):
279279

280280
em.add_field(name="Keywords", value=lucky[5], inline=False)
281281

282-
if lucky[14] != "":
282+
if lucky[14] and lucky[14].lower() != "n/a":
283283
em.add_field(name="Project Art", value="[Click Here](%s)" % lucky[14], inline=True)
284284
else:
285285
pass
286286

287-
if lucky[15] != "":
287+
if lucky[15] and lucky[15].lower() != "n/a":
288288
em.add_field(name="Additional Content", value="[Click Here](%s)" % lucky[15], inline=True)
289289
else:
290290
pass
@@ -533,17 +533,61 @@ async def on_member_join(member):
533533
async def on_voice_state_update(before, after):
534534
try:
535535
server = after.server
536-
if (str(after.voice_channel) == "#voice"):
537-
await client.add_roles(after,discord.utils.get(server.roles, name='in voice'))
536+
VoiceList = ["voice", "Patricians", "Wild West"]
537+
if (str(after.voice_channel) in VoiceList):
538+
await client.add_roles(after,discord.utils.get(server.roles, name='in_voice'))
538539
print("Given 'in voice' role to %s \n" % str(after))
539540
elif after.voice_channel == None:
540-
await client.remove_roles(after,discord.utils.get(server.roles, name='in voice'))
541+
await client.remove_roles(after,discord.utils.get(server.roles, name='in_voice'))
541542
print("Taken 'in voice' role from %s \n" % str(after))
542543
else:
543544
pass
544545
except:
545546
print("Error K800")
546547

548+
@client.command(pass_context = True, description="Mod only command, posts image")
549+
async def wb(ctx):
550+
try:
551+
wbImages = ["https://cdn.discordapp.com/attachments/221333052629057536/376535932003811328/image.jpg",
552+
"https://imgur.com/Dajz8Re",
553+
"https://cdn.discordapp.com/attachments/221333052629057536/380517117759324161/worldbuilding_2.jpg",
554+
"https://cdn.discordapp.com/attachments/221333052629057536/380520533529198594/unknown.png",
555+
"https://i.gyazo.com/99ec60315371d5f4b62fc31175bb08fa.png",
556+
"https://cdn.discordapp.com/attachments/193833682203705345/380536568365973504/please_talk_about_worldbuilding.jpg",
557+
"https://cdn.discordapp.com/attachments/221333052629057536/386627117271613442/Talk_About_Worldbuilding.jpg"]
558+
559+
authors = ["Teeteegone",
560+
"Urmille",
561+
"Yazuki",
562+
"Shagomir",
563+
"ProkhorVLG",
564+
"Caba111",
565+
"Yazuki"]
566+
567+
if (len(ctx.message.content) == 5):
568+
chosenImage = (int(ctx.message.content[4:])) - 1
569+
570+
await client.say(wbImages[chosenImage])
571+
await client.delete_message(ctx.message)
572+
out = "Artist Credit: ", authors[chosenImage]
573+
await client.say(out)
574+
575+
elif checkmod(config.modteam,ctx.message) == True:
576+
#pick a random number and set it to print
577+
rand = random.randint(0,len(wbImages))
578+
579+
#print to chat
580+
await client.say(wbImages[rand])
581+
await client.delete_message(ctx.message)
582+
out = ("Artist Credit: ", authors[rand])
583+
await client.say(out)
584+
585+
#if user isn't a mod
586+
else:
587+
await client.say("This command is only available for mods and admins.")
588+
except:
589+
print("Error K900")
590+
547591
loop = asyncio.get_event_loop()
548592

549593
## init client ##

0 commit comments

Comments
 (0)