Skip to content

Commit

Permalink
Disable unused intents
Browse files Browse the repository at this point in the history
  • Loading branch information
Zingzy committed Mar 15, 2024
1 parent 960c97f commit d1f3c60
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
TOKEN=
APP_URI=
MONGODB_URI=
2 changes: 1 addition & 1 deletion cogs/leaderboard_cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async def leaderboard_command(self, interaction):
except Exception as e:
top_user_avatar = top_user.default_avatar.url

embed = discord.Embed(title="Top 10 prompters", color=discord.Color.gold(), description="This Shows the top 10 bot users across all of the servers the bot is in.", timestamp=datetime.datetime.utcnow())
embed = discord.Embed(title="Top 10 prompters", color=discord.Color.gold(), description="This Shows the top 10 bot users across all of the servers the bot is in.", timestamp=datetime.datetime.now(datetime.UTC))
embed.set_thumbnail(url=top_user_avatar)

embed.add_field(name=f"{NUMBER_EMOJIES[1]} {top_user.name} - {leaderboard[top_user_id]} points", value="** **")
Expand Down
3 changes: 1 addition & 2 deletions constants.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import os
from dotenv import load_dotenv

load_dotenv()
load_dotenv(override=True)

TOKEN = os.environ["TOKEN"]
MONGODB_URI = os.environ["MONGODB_URI"]
APP_URI = os.environ["APP_URI"]
MODELS = [
"swizz8",
"dreamshaper",
Expand Down
13 changes: 8 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@

class pollinationsBot(commands.Bot):
def __init__(self):
intents = discord.Intents.default()
intents.messages = True
intents.message_content = True

super().__init__(
command_prefix="!", intents=discord.Intents.all(), help_command=None
command_prefix="!", intents=intents, help_command=None
)
self.synced = False

Expand All @@ -68,7 +72,7 @@ async def on_ready(self):
await load()

global start_time
start_time = datetime.datetime.utcnow()
start_time = datetime.datetime.now(datetime.UTC)

await self.wait_until_ready()
if not self.synced:
Expand Down Expand Up @@ -155,7 +159,7 @@ async def ping(ctx):
)

global start_time
current_time = datetime.datetime.utcnow()
current_time = datetime.datetime.now(datetime.UTC)
delta = current_time - start_time

hours, remainder = divmod(int(delta.total_seconds()), 3600)
Expand Down Expand Up @@ -187,7 +191,6 @@ async def help(ctx):

embed = discord.Embed(
title="Pollinations.ai Bot Commands",
url=APP_URI,
description="Here is the list of the available commands:",
color=discord.Color.og_blurple(),
)
Expand Down Expand Up @@ -271,5 +274,5 @@ async def about(ctx):


if __name__ == "__main__":
keep_alive()
# keep_alive() # used for keeping the bot alive if hosten on a cloud platform
bot.run(token=TOKEN)

0 comments on commit d1f3c60

Please sign in to comment.