Skip to content

Commit ed46564

Browse files
RedTeaDevColaIan
andauthored
update requirement and fix typo (#33)
* Update Teapot.py requirements Signed-off-by: RedTeaDev <redtea@redtea.red> * Updated typo and grammar issues in README.md * fix some bug and added /tp debug * Fixed typo, update requirements Signed-off-by: RedTeaDev <redtea@redtea.red> * update requirement * make requirements use '>=', and use mysql-connector-python, since mysql-connector is Deprecated Co-authored-by: ColaIan <43201383+ColaIan@users.noreply.github.com>
1 parent 2b9c79f commit ed46564

File tree

5 files changed

+77
-38
lines changed

5 files changed

+77
-38
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
This project is currently in development!<br>
1515
</h2>
1616
<h4 align="center">
17-
If you would like to be notified when we commit, please watch this repository and join our Discord server.
17+
If you would like to be notified when we commit, please watch this repository and join our Discord server.
1818
</h4>
1919

2020

2121
## 👋 About
2222

23-
Teapot.py is an open source Discord bot that aims to be as customisable as possible as well as providing essential tools for server administrators to run their Discord server!
23+
Teapot.py is an open-source Discord bot that aims to be as customizable as possible as well as providing essential tools for server administrators to run their Discord server!
2424

2525
If you want to try it out by yourself, feel free to invite it to your Discord server by clicking [Here](https://discordapp.com/oauth2/authorize?client_id=669880564270104586&permissions=8&scope=bot)!
2626

@@ -33,10 +33,10 @@ If you want to try it out by yourself, feel free to invite it to your Discord se
3333

3434
## 📖 Wiki
3535

36-
Our wiki is currently work in progreses, please check back later!
36+
Our wiki is currently work in progress, please check back later!
3737

3838
## 🤝 Contributing
39-
Contributions, feedback and bug reports are welcome! Feel free to check out our [issues page](https://github.com/RedCokeDevelopment/Teapot.py/issues) to find out what you could do!
39+
Contributions, feedback, and bug reports are welcome! Feel free to check out our [issues page](https://github.com/RedCokeDevelopment/Teapot.py/issues) to find out what you could do!
4040

4141
Before contributing, we recommend you say hi over in our [Discord server](https://discord.gg/7BRGs6F)! We can provide support with any issues you may have 🙂
4242

Teapot.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from discord.ext import commands as dcmd
99
from dotenv import load_dotenv
1010

11-
import teapot
11+
import teapot # import teapot.py core
1212

1313
print(f"""
1414
_____ _
@@ -35,16 +35,16 @@
3535
if not versionlisted:
3636
print("You are currently using an unlisted version!\n")
3737
elif req.status_code == 404:
38-
# 404 Not Found
38+
# 404 Not Found
3939
print("Latest Teapot.py version not found!\n")
4040
elif req.status_code == 500:
41-
# 500 Internal Server Error
41+
# 500 Internal Server Error
4242
print("An error occurred while fetching the latest Teapot.py version. [500 Internal Server Error]\n")
4343
elif req.status_code == 502:
44-
# 502 Bad Gateway
44+
# 502 Bad Gateway
4545
print("An error occurred while fetching the latest Teapot.py version. [502 Bad Gateway]\n")
4646
elif req.status_code == 503:
47-
# 503 Service Unavailable
47+
# 503 Service Unavailable
4848
print("An error occurred while fetching the latest Teapot.py version. [503 Service Unavailable]\n")
4949
else:
5050
print("An unknown error has occurred when fetching the latest Teapot.py version\n")
@@ -54,13 +54,13 @@
5454

5555
if os.getenv('CONFIG_VERSION') != teapot.config_version():
5656
if os.path.isfile('.env'):
57-
print("Missing environment variables. Please backup and delete .env, then run Teapot.py again.")
57+
print("Missing environment variables. Please backup and delete .env, then run Teapot.py again.")
5858
quit(2)
59-
print("Unable to find required environment variables. Running setup.py...") # if .env not found
60-
teapot.setup.__init__() # run setup.py
59+
print("Unable to find required environment variables. Running setup.py...") # if .env not found
60+
teapot.setup.__init__() # run setup.py
6161

6262
print("Initializing bot...")
63-
if teapot.config.storage_type() == "mysql": # if .env use mysql, create the table if table not exists
63+
if teapot.config.storage_type() == "mysql": # if .env use mysql, create the table if table not exists
6464
time_start = time.perf_counter()
6565
database = teapot.managers.database.__init__()
6666
db = teapot.managers.database.db(database)
@@ -101,10 +101,10 @@ async def on_ready():
101101
for guild in bot.guilds:
102102
teapot.managers.database.create_guild_table(guild)
103103
elif teapot.config.storage_type() == "sqlite":
104-
print("[!] Warning: SQLite storage has not been implemented yet. MySQL database is recommended") # WIP
104+
print("[!] Warning: SQLite storage has not been implemented yet. MySQL database is recommended") # WIP
105105
print(f"Registered commands and events in {round(time.perf_counter() - time_start, 2)}s")
106-
await bot.change_presence(status=discord.Status.online, activity=discord.Game(teapot.config.bot_status())) # Update Bot status
107-
106+
await bot.change_presence(status=discord.Status.online,
107+
activity=discord.Game(teapot.config.bot_status())) # Update Bot status
108108

109109

110110
try:
@@ -115,4 +115,5 @@ async def on_ready():
115115
if teapot.config.storage_type() == "mysql":
116116
db.execute("INSERT INTO `bot_logs`(timestamp, type, class, message) VALUES(%s, %s, %s, %s)",
117117
(teapot.time(), "ERROR", __name__, e))
118-
exit(9)
118+
time.sleep(5)
119+
exit(1)

requirements.txt

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
aiohttp==3.6.2
2-
async-timeout==3.0.1
3-
attrs==20.2.0
4-
beautifulsoup4==4.9.3
5-
bs4==0.0.1
6-
certifi==2020.6.20
7-
chardet==3.0.4
8-
discord.py==1.5.0
9-
idna==2.10
10-
lavalink==3.1.2
11-
multidict==4.7.6
12-
mysql-connector==2.2.9
13-
python-dotenv==0.14.0
14-
requests==2.24.0
15-
soupsieve==2.0.1
16-
urllib3==1.25.10
17-
websockets==8.1
18-
yarl==1.6.0
1+
2+
aiohttp>=3.6.2
3+
async-timeout>=3.0.1
4+
attrs>=19.3.0
5+
beautifulsoup4>=4.9.1
6+
bs4>=0.0.1
7+
certifi>=2020.6.20
8+
chardet>=3.0.4
9+
discord.py>=1.4.0
10+
idna>=2.10
11+
lavalink>=3.1.2
12+
multidict>=4.7.6
13+
mysql-connector>=2.2.9
14+
psutil>=5.7.2
15+
python-dotenv>=0.14.0
16+
requests>=2.24.0
17+
soupsieve>=2.0.1
18+
typing-extensions>=3.7.4.2
19+
urllib3>=1.25.10
20+
websockets>=8.1
21+
yarl>=1.5.1
22+
mysql-connector-python>=8.0.21

teapot/cogs/cmds.py

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import discord
2+
import time
3+
import psutil
24
from discord.ext import commands as cmd
35

46
import teapot
@@ -14,6 +16,7 @@ def __init__(bot):
1416
ban(bot)
1517
admin(bot)
1618
owner(bot)
19+
debug(bot)
1720

1821

1922
def helpcmd(bot):
@@ -72,7 +75,7 @@ async def help(ctx, *cog):
7275
def info(bot):
7376
@bot.command(aliases=['about'])
7477
async def info(ctx):
75-
embed = discord.Embed(title="Developers: RedTea, ColaIan", description="Multi-purpose Discord Bot",
78+
embed = discord.Embed(title="Developers: RedTeaDev, ColaIan", description="Multi-purpose Discord Bot",
7679
color=0x7400FF)
7780
embed.set_author(name=f"Teapot.py {teapot.version()}",
7881
icon_url="https://cdn.discordapp.com/avatars/612634758744113182/7fe078b5ea6b43000dfb7964e3e4d21d.png?size=512")
@@ -122,7 +125,7 @@ async def prune(ctx, amount=0):
122125

123126
def kick(bot):
124127
@bot.command()
125-
@cmd.has_permissions(kick_members=True) # check user permission
128+
@cmd.has_permissions(kick_members=True) # check user permission
126129
async def kick(ctx, member: discord.Member, *, reason=None):
127130
try:
128131
await member.kick(reason=reason)
@@ -169,3 +172,34 @@ async def owner(ctx):
169172
if role.name == "Teapot Owner":
170173
await ctx.guild.get_member(teapot.config.bot_owner()).add_roles(role)
171174
break
175+
176+
177+
def debug(bot):
178+
@bot.command()
179+
@cmd.has_permissions(administrator=True)
180+
async def debug(ctx):
181+
embed = discord.Embed(title="Developers: RedTea, ColaIan", description="Debug info:",
182+
color=0x7400FF)
183+
embed.set_author(name=f"Teapot.py {teapot.version()}",
184+
icon_url="https://cdn.discordapp.com/avatars/612634758744113182/7fe078b5ea6b43000dfb7964e3e4d21d.png?size=512")
185+
embed.set_thumbnail(url="https://avatars2.githubusercontent.com/u/60006969?s=200&v=4")
186+
embed.add_field(name="Bot User:", value=bot.user, inline=True)
187+
embed.add_field(name="System Time:", value=time.strftime("%a %b %d %H:%M:%S %Y", time.localtime()), inline=True)
188+
embed.add_field(name="Memory",
189+
value=str(round(psutil.virtual_memory()[1] / 1024 / 1024 / 1024)) + "GB / " + str(round(
190+
psutil.virtual_memory()[0] / 1024 / 1024 / 1024)) + "GB", inline=True)
191+
embed.add_field(name="O.S.:", value=str(teapot.platform()), inline=True)
192+
embed.add_field(name="Storage Type:", value=teapot.config.storage_type(), inline=True)
193+
embed.add_field(name="Prefix:", value=", ".join(teapot.config.bot_prefix()), inline=True)
194+
embed.add_field(name="Github Repo:", value="[Teapot.py](https://github.com/RedCokeDevelopment/Teapot.py)",
195+
inline=True)
196+
embed.add_field(name="Bug Report:", value="[Issues](https://github.com/RedCokeDevelopment/Teapot.py/issues)",
197+
inline=True)
198+
embed.add_field(name="Website:", value="[Website](https://teapot.page)", inline=True)
199+
embed.add_field(name="Links",
200+
value="[Support Discord](https://discord.gg/7BRGs6F) | [Add bot to server](https://discordapp.com/oauth2/authorize?client_id=669880564270104586&permissions=8&scope=bot) | [Repository](https://github.com/RedCokeDevelopment/Teapot.py)",
201+
inline=False)
202+
embed.set_footer(text=f"{teapot.copyright()} | Code licensed under the MIT License")
203+
# embed.set_image(url="https://user-images.githubusercontent.com/43201383/72987537-89830a80-3e25-11ea-95ef-ecfa0afcff7e.png")
204+
await ctx.message.author.send(embed=embed)
205+
await ctx.message.add_reaction(emoji='✅')

teapot/cogs/music.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,4 +292,4 @@ async def ensure_voice(self, ctx):
292292

293293
def setup(bot):
294294
""" Initialize music module """
295-
bot.add_cog(Music(bot))
295+
bot.add_cog(Music(bot))

0 commit comments

Comments
 (0)