Skip to content

Commit

Permalink
Template v4.0.1
Browse files Browse the repository at this point in the history
* Fixed some *weird* code
  • Loading branch information
Krypton committed Nov 28, 2021
1 parent 52f28b9 commit 86f3e71
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 34 deletions.
4 changes: 4 additions & 0 deletions UPDATES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Here is the list of all the updates that I made on this template.

### Version 4.0.1

* Fixed some *weird* code

### Version 4.0

* Now using [`disnake`](https://docs.disnake.dev)
Expand Down
4 changes: 2 additions & 2 deletions bot.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
""""
Copyright © Krypton 2021 - https://github.com/kkrypt0nn
Copyright © Krypton 2021 - https://github.com/kkrypt0nn (https://krypt0n.co.uk)
Description:
This is a template to create your own discord bot in python.
Version: 4.0
Version: 4.0.1
"""

import json
Expand Down
18 changes: 2 additions & 16 deletions cogs/fun.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
""""
Copyright © Krypton 2021 - https://github.com/kkrypt0nn
Copyright © Krypton 2021 - https://github.com/kkrypt0nn (https://krypt0n.co.uk)
Description:
This is a template to create your own discord bot in python.
Version: 4.0
Version: 4.0.1
"""

import json
Expand Down Expand Up @@ -118,13 +118,6 @@ async def randomfact(self, interaction: ApplicationCommandInteraction):
"""
Get a random fact.
"""

# This is, for now, only temporary
with open("blacklist.json") as file:
blacklist = json.load(file)
if interaction.author.id in blacklist["ids"]:
return

# This will prevent your bot from stopping everything when doing a web request - see: https://discordpy.readthedocs.io/en/stable/faq.html#how-do-i-make-a-web-request
async with aiohttp.ClientSession() as session:
async with session.get("https://uselessfacts.jsph.pl/random.json?language=en") as request:
Expand All @@ -151,13 +144,6 @@ async def randomfact(self, context: Context):
"""
Get a random fact.
"""

# This is, for now, only temporary
with open("blacklist.json") as file:
blacklist = json.load(file)
if context.author.id in blacklist["ids"]:
return

# This will prevent your bot from stopping everything when doing a web request - see: https://discordpy.readthedocs.io/en/stable/faq.html#how-do-i-make-a-web-request
async with aiohttp.ClientSession() as session:
async with session.get("https://uselessfacts.jsph.pl/random.json?language=en") as request:
Expand Down
8 changes: 4 additions & 4 deletions cogs/general.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
""""
Copyright © Krypton 2021 - https://github.com/kkrypt0nn
Copyright © Krypton 2021 - https://github.com/kkrypt0nn (https://krypt0n.co.uk)
Description:
This is a template to create your own discord bot in python.
Version: 4.0
Version: 4.0.1
"""

import json
Expand Down Expand Up @@ -325,7 +325,7 @@ async def eight_ball(self, interaction: ApplicationCommandInteraction, question:
'My sources say no.', 'Outlook not so good.', 'Very doubtful.']
embed = disnake.Embed(
title="**My Answer:**",
description=f"{answers[random.randint(0, len(answers) - 1)]}",
description=f"{random.choice(answers)}",
color=0x9C84EF
)
embed.set_footer(
Expand All @@ -349,7 +349,7 @@ async def eight_ball(self, context: Context, *, question: str):
'My sources say no.', 'Outlook not so good.', 'Very doubtful.']
embed = disnake.Embed(
title="**My Answer:**",
description=f"{answers[random.randint(0, len(answers) - 1)]}",
description=f"{random.choice(answers)}",
color=0x9C84EF
)
embed.set_footer(
Expand Down
4 changes: 2 additions & 2 deletions cogs/moderation.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
""""
Copyright © Krypton 2021 - https://github.com/kkrypt0nn
Copyright © Krypton 2021 - https://github.com/kkrypt0nn (https://krypt0n.co.uk)
Description:
This is a template to create your own discord bot in python.
Version: 4.0
Version: 4.0.1
"""

import json
Expand Down
4 changes: 2 additions & 2 deletions cogs/owner.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
""""
Copyright © Krypton 2021 - https://github.com/kkrypt0nn
Copyright © Krypton 2021 - https://github.com/kkrypt0nn (https://krypt0n.co.uk)
Description:
This is a template to create your own discord bot in python.
Version: 4.0
Version: 4.0.1
"""

import json
Expand Down
4 changes: 2 additions & 2 deletions cogs/template.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
""""
Copyright © Krypton 2021 - https://github.com/kkrypt0nn
Copyright © Krypton 2021 - https://github.com/kkrypt0nn (https://krypt0n.co.uk)
Description:
This is a template to create your own discord bot in python.
Version: 4.0
Version: 4.0.1
"""

import json
Expand Down
4 changes: 2 additions & 2 deletions exceptions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
""""
Copyright © Krypton 2021 - https://github.com/kkrypt0nn
Copyright © Krypton 2021 - https://github.com/kkrypt0nn (https://krypt0n.co.uk)
Description:
This is a template to create your own discord bot in python.
Version: 4.0
Version: 4.0.1
"""


Expand Down
4 changes: 2 additions & 2 deletions helpers/checks.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
""""
Copyright © Krypton 2021 - https://github.com/kkrypt0nn
Copyright © Krypton 2021 - https://github.com/kkrypt0nn (https://krypt0n.co.uk)
Description:
This is a template to create your own discord bot in python.
Version: 4.0
Version: 4.0.1
"""

import json
Expand Down
4 changes: 2 additions & 2 deletions helpers/json_manager.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
""""
Copyright © Krypton 2021 - https://github.com/kkrypt0nn
Copyright © Krypton 2021 - https://github.com/kkrypt0nn (https://krypt0n.co.uk)
Description:
This is a template to create your own discord bot in python.
Version: 4.0
Version: 4.0.1
"""

import json
Expand Down

0 comments on commit 86f3e71

Please sign in to comment.