mirror of
https://github.com/NoiTheCat/WorldTime.git
synced 2024-11-21 14:34:36 +00:00
Switch to intents
This commit is contained in:
parent
dbec6309a8
commit
5e59acbacf
2 changed files with 7 additions and 5 deletions
|
@ -240,7 +240,7 @@ class WtCommands:
|
|||
"""
|
||||
Takes a string input and attempts to find the corresponding member.
|
||||
"""
|
||||
if guild.large: await self.dclient.request_offline_members(guild)
|
||||
if not guild.chunked: await guild.chunk()
|
||||
idsearch = None
|
||||
try:
|
||||
idsearch = int(inputstr)
|
||||
|
|
10
worldtime.py
10
worldtime.py
|
@ -8,7 +8,7 @@
|
|||
# pytz, psycopg2, discord.py
|
||||
# How to install the latter: pip install -U git+https://github.com/Rapptz/discord.py
|
||||
|
||||
from discord import Game
|
||||
from discord import Intents
|
||||
from client import WorldTime
|
||||
import settings
|
||||
import common
|
||||
|
@ -23,12 +23,14 @@ if __name__ == '__main__':
|
|||
print("Bot token not set. Will not continue.")
|
||||
exit()
|
||||
|
||||
# Note: Cannot disable guild_subscriptions - disables user cache when used in tandem w/ fetch_offline_members
|
||||
# todo: sharding options handled here: pass shard_id and shard_count parameters
|
||||
subscribedIntents = Intents.none()
|
||||
subscribedIntents.guilds = True
|
||||
subscribedIntents.members = True
|
||||
subscribedIntents.guild_messages = True
|
||||
client = WorldTime(
|
||||
fetch_offline_members=False,
|
||||
# guild_subscriptions=False,
|
||||
max_messages=None,
|
||||
intents = subscribedIntents
|
||||
)
|
||||
|
||||
client.run(settings.BotToken)
|
||||
|
|
Loading…
Reference in a new issue