Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues with attachments #83

Merged
merged 1 commit into from
May 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from logging import basicConfig, DEBUG, error, info, INFO
from multiprocessing import Process
from os import getenv, listdir, makedirs, name, path, system, remove
from subprocess import PIPE
from subprocess import PIPE, call
from sys import exc_info
from traceback import format_exc
from typing import Union
Expand Down
2 changes: 0 additions & 2 deletions cogs/dj/playlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
class Dj(Cog, name="dj.playlist"):
def __init__(self, bot):
self.bot = bot
self.url_rx = re_compile(r"https?://(?:www\.)?.+")
self.path = "temp/musics/"

@command(
name="playlist",
Expand Down
12 changes: 4 additions & 8 deletions data/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,9 +642,7 @@ async def init_guild(self, guild: Guild):

""" INIT """

bot.moderators[guild.id] = list(
[int(k) for k in bot.config_repo.get_moderators(guild.id).keys()]
) # Initialize moderators list for every guilds
bot.moderators[guild.id] = [int(k) for k in bot.config_repo.get_moderators(guild.id).keys()] # Initialize moderators list for every guilds

bot.tasks[guild.id] = {"mute_completions": {}, "ban_completions": {}}

Expand Down Expand Up @@ -743,9 +741,7 @@ async def init_guild(self, guild: Guild):

bot.playlists[guild.id] = []

bot.djs[guild.id] = list(
[int(k) for k in bot.config_repo.get_djs(guild.id).keys()]
) # Initialize moderators list for every guilds
bot.djs[guild.id] = [int(k) for k in bot.config_repo.get_djs(guild.id).keys()] # Initialize djs list for every guilds

""" COMMANDS CHANNELS """

Expand Down Expand Up @@ -892,7 +888,7 @@ def task_launcher(function, param, **interval) -> loop:
@staticmethod
def is_mod(member: Member, bot: Omnitron) -> bool:
return (
set(member.roles) & set(bot.moderators[member.guild.id])
set(r.id for r in member.roles) & set(bot.moderators[member.guild.id])
or member.id in set(bot.moderators[member.guild.id])
or member.guild_permissions.administrator
)
Expand All @@ -901,7 +897,7 @@ def is_mod(member: Member, bot: Omnitron) -> bool:
def is_dj(member: Member, bot: Omnitron) -> bool:
return (
not bot.djs[member.guild.id]
or set(member.roles) & set(bot.djs[member.guild.id])
or set(r.id for r in member.roles) & set(bot.djs[member.guild.id])
or member.id in set(bot.djs[member.guild.id])
or member.guild_permissions.administrator
)
Expand Down