|
14 | 14 |
|
15 | 15 | client = commands.Bot(command_prefix='.', description='This an automated bot for r/worldbuilding discord server', pm_help= True)
|
16 | 16 | 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" |
19 | 19 | manual = "https://github.com/Kazandaki/KazTron/wiki"
|
20 | 20 | github = "https://github.com/Kazandaki/KazTron"
|
21 | 21 | roadmap = "https://docs.google.com/spreadsheets/d/1ScVRoondp50HoonVBTZz8WUmfkLnDlGaomJrG0pgGs0/edit?usp=sharing"
|
|
36 | 36 |
|
37 | 37 | @client.event
|
38 | 38 | 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')) |
40 | 40 | print('\n')
|
41 | 41 | print('Logged in as')
|
42 | 42 | print(client.user.name)
|
@@ -279,12 +279,12 @@ async def spotlight(ctx):
|
279 | 279 |
|
280 | 280 | em.add_field(name="Keywords", value=lucky[5], inline=False)
|
281 | 281 |
|
282 |
| - if lucky[14] != "": |
| 282 | + if lucky[14] and lucky[14].lower() != "n/a": |
283 | 283 | em.add_field(name="Project Art", value="[Click Here](%s)" % lucky[14], inline=True)
|
284 | 284 | else:
|
285 | 285 | pass
|
286 | 286 |
|
287 |
| - if lucky[15] != "": |
| 287 | + if lucky[15] and lucky[15].lower() != "n/a": |
288 | 288 | em.add_field(name="Additional Content", value="[Click Here](%s)" % lucky[15], inline=True)
|
289 | 289 | else:
|
290 | 290 | pass
|
@@ -533,17 +533,61 @@ async def on_member_join(member):
|
533 | 533 | async def on_voice_state_update(before, after):
|
534 | 534 | try:
|
535 | 535 | 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')) |
538 | 539 | print("Given 'in voice' role to %s \n" % str(after))
|
539 | 540 | 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')) |
541 | 542 | print("Taken 'in voice' role from %s \n" % str(after))
|
542 | 543 | else:
|
543 | 544 | pass
|
544 | 545 | except:
|
545 | 546 | print("Error K800")
|
546 | 547 |
|
| 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 | + |
547 | 591 | loop = asyncio.get_event_loop()
|
548 | 592 |
|
549 | 593 | ## init client ##
|
|
0 commit comments