Skip to content

Commit 0e2c8a4

Browse files
committed
fix some bug and added /tp debug
1 parent b87726a commit 0e2c8a4

File tree

4 files changed

+42
-8
lines changed

4 files changed

+42
-8
lines changed

Teapot.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
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

13-
print(f"""
13+
print("""
1414
_____ _
1515
|_ _|__ __ _ _ __ ___ | |_
1616
| |/ _ \\/ _` | '_ \\ / _ \\| __|
@@ -105,8 +105,6 @@ async def on_ready():
105105
print(f"Registered commands and events in {round(time.perf_counter() - time_start, 2)}s")
106106
await bot.change_presence(status=discord.Status.online, activity=discord.Game(teapot.config.bot_status())) # Update Bot status
107107

108-
109-
110108
try:
111109
discord_time_start = time.perf_counter()
112110
bot.run(teapot.config.bot_token())
@@ -115,4 +113,5 @@ async def on_ready():
115113
if teapot.config.storage_type() == "mysql":
116114
db.execute("INSERT INTO `bot_logs`(timestamp, type, class, message) VALUES(%s, %s, %s, %s)",
117115
(teapot.time(), "ERROR", __name__, e))
118-
exit(9)
116+
time.sleep(5)
117+
exit(1)

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ idna==2.10
1010
lavalink==3.1.2
1111
multidict==4.7.6
1212
mysql-connector==2.2.9
13+
psutil==5.7.2
1314
python-dotenv==0.14.0
1415
requests==2.24.0
1516
soupsieve==2.0.1

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)