Update main.py
Some checks failed
Pylint / Pylint (push) Failing after 38s

This commit is contained in:
Seaswimmer 2023-09-24 08:10:26 -04:00
parent 506dda09b3
commit e092e79d14

13
main.py
View file

@ -6,8 +6,8 @@ import dotenv
import revolt import revolt
from dotenv import load_dotenv from dotenv import load_dotenv
from revolt.ext import commands from revolt.ext import commands
from cogs.moderation import Moderation
from cogs.info import Info from cogs.info import Info
from cogs.moderation import Moderation
from utils.embed import CustomEmbed from utils.embed import CustomEmbed
# This code reads the variables set in the bot's '.env' file. # This code reads the variables set in the bot's '.env' file.
@ -26,9 +26,14 @@ class Client(commands.CommandsClient):
return prefix return prefix
return input return input
async def on_ready(self):
for server in self.servers:
Moderation.create_server_table(self, server)
print(f"Logged in as {self.user.name}#{self.user.discriminator} ({self.user.id})")
async def on_server_join(self, server: revolt.Server): async def on_server_join(self, server: revolt.Server):
print(f"Joined server: {server.name} ({server.id})") print(f"Joined server: {server.name} ({server.id})")
Moderation.create_server_table(self, server.id) Moderation.create_server_table(self, server)
async def on_message_delete(self, message: revolt.Message): async def on_message_delete(self, message: revolt.Message):
if isinstance(message.author, revolt.Member): if isinstance(message.author, revolt.Member):
@ -74,8 +79,8 @@ class Client(commands.CommandsClient):
before = time.monotonic() before = time.monotonic()
msg = await ctx.message.reply("🏓") msg = await ctx.message.reply("🏓")
ping = (time.monotonic() - before) * 1000 ping = (time.monotonic() - before) * 1000
embeds = [CustomEmbed(title="🏓 Pong!", description=f"`\n{int(ping)} ms`", colour="#5d82d1")] embed = [CustomEmbed(title="🏓 Pong!", description=f"`\n{int(ping)} ms`", colour="#5d82d1")]
await msg.edit(content=" ", embeds=embeds) await msg.edit(content=" ", embeds=embed)
print(f'Ping {int(ping)}ms') print(f'Ping {int(ping)}ms')
async def prefix_change(self, message: revolt.Message, new_prefix: str, silent: bool | None = False): async def prefix_change(self, message: revolt.Message, new_prefix: str, silent: bool | None = False):