Skip to content

Commit

Permalink
Fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-ni committed Jun 27, 2021
1 parent b964879 commit e3af7d6
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cogs/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ async def on_error(self, ctx: commands.Context, error):
print("\n\n")

def sendable_channel(self, channel):
if channel.guild.me.permissions_in(channel).send_messages:
if channel.permissions_for(channel.guild.me).send_messages:
return channel
return None

Expand All @@ -159,7 +159,7 @@ async def on_guild_join(self, guild):
channel = next(
x
for x in channels
if isinstance(x, TextChannel) and guild.me.permissions_in(x).send_messages
if isinstance(x, TextChannel) and x.permissions_for(guild.me).send_messages
)
except StopIteration:
return
Expand Down
2 changes: 1 addition & 1 deletion cogs/pokemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ async def pokedex(self, ctx, **flags):
num = await self.bot.mongo.fetch_pokedex_count(ctx.author)

do_emojis = (
ctx.guild is None or ctx.guild.me.permissions_in(ctx.channel).external_emojis
ctx.guild is None or ctx.channel.permissions_for(ctx.guild.me).external_emojis
)

member = await self.bot.mongo.fetch_pokedex(ctx.author, 0, 898 + 1)
Expand Down
6 changes: 3 additions & 3 deletions cogs/shop.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async def vote(self, ctx):
# )
# member = await self.bot.mongo.fetch_member_info(ctx.author)

do_emojis = ctx.guild is None or ctx.guild.me.permissions_in(ctx.channel).external_emojis
do_emojis = ctx.guild is None or ctx.channel.permissions_for(ctx.guild.me).external_emojis

embed = self.bot.Embed(color=0xFE9AC9)
embed.title = f"Voting Rewards"
Expand Down Expand Up @@ -168,7 +168,7 @@ async def vote(self, ctx):
async def open(self, ctx, type: str = "", amt: int = 1):
"""Open mystery boxes received from voting."""

do_emojis = ctx.guild is None or ctx.guild.me.permissions_in(ctx.channel).external_emojis
do_emojis = ctx.guild is None or ctx.channel.permissions_for(ctx.guild.me).external_emojis

if type.lower() not in ("normal", "great", "ultra", "master"):
if type.lower() in ("n", "g", "u", "m"):
Expand Down Expand Up @@ -427,7 +427,7 @@ async def shop(self, ctx, *, page: int = 0):
items = [i for i in self.bot.data.all_items() if i.page == page]

do_emojis = (
ctx.guild is None or ctx.guild.me.permissions_in(ctx.channel).external_emojis
ctx.guild is None or ctx.channel.permissions_for(ctx.guild.me).external_emojis
)

for item in items:
Expand Down
1 change: 0 additions & 1 deletion docker_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
cluster_name=str(cluster_idx),
cluster_idx=cluster_idx,
case_insensitive=True,
fetch_offline_members=False,
member_cache_flags=discord.MemberCacheFlags.none(),
allowed_mentions=discord.AllowedMentions(everyone=False, roles=False),
intents=discord.Intents.default(),
Expand Down
5 changes: 5 additions & 0 deletions helpers/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ def __init__(self, source, allow_last=True, allow_go=True, **kwargs):
for x in REMOVE_BUTTONS:
self.remove_button(x)

async def send_initial_message(self, ctx, channel):
page = await self._source.get_page(self.current_page)
kwargs = await self._get_kwargs_from_page(page)
return await self.send_with_view(channel, **kwargs)

async def show_checked_page(self, page_number):
max_pages = self._source.get_max_pages()
try:
Expand Down
1 change: 0 additions & 1 deletion launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ def __init__(self, launcher, name, shard_ids, max_shards):
cluster_name=name,
cluster_idx=CLUSTER_NAMES.index(name),
case_insensitive=True,
fetch_offline_members=False,
member_cache_flags=discord.MemberCacheFlags.none(),
allowed_mentions=discord.AllowedMentions(everyone=False, roles=False),
intents=intents,
Expand Down

0 comments on commit e3af7d6

Please sign in to comment.