Switch to intents

This commit is contained in:
Noi 2021-04-22 12:20:30 -07:00
parent dbec6309a8
commit 5e59acbacf
2 changed files with 7 additions and 5 deletions

View file

@ -240,7 +240,7 @@ class WtCommands:
""" """
Takes a string input and attempts to find the corresponding member. 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 idsearch = None
try: try:
idsearch = int(inputstr) idsearch = int(inputstr)

View file

@ -8,7 +8,7 @@
# pytz, psycopg2, discord.py # pytz, psycopg2, discord.py
# How to install the latter: pip install -U git+https://github.com/Rapptz/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 from client import WorldTime
import settings import settings
import common import common
@ -23,12 +23,14 @@ if __name__ == '__main__':
print("Bot token not set. Will not continue.") print("Bot token not set. Will not continue.")
exit() 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 # 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( client = WorldTime(
fetch_offline_members=False,
# guild_subscriptions=False,
max_messages=None, max_messages=None,
intents = subscribedIntents
) )
client.run(settings.BotToken) client.run(settings.BotToken)