🎨 - Code cleaning

This commit is contained in:
Florian SYLVAIN
2021-03-07 02:13:06 +01:00
parent 0556dd3300
commit 5aa42faa6c
3 changed files with 2 additions and 8 deletions
-2
View File
@@ -3,10 +3,8 @@ import asyncio
from discord.ext import commands from discord.ext import commands
from discord.ext.commands.cooldowns import BucketType from discord.ext.commands.cooldowns import BucketType
CD_ISSOU = 0 CD_ISSOU = 0
class OtherCmds(commands.Cog): class OtherCmds(commands.Cog):
def __init__(self, bot): def __init__(self, bot):
self.bot = bot self.bot = bot
+1 -3
View File
@@ -8,11 +8,9 @@ from discord.ext.commands.cooldowns import BucketType
from emoji import demojize from emoji import demojize
from twitch import TwitchClient from twitch import TwitchClient
twitch_client = TwitchClient(client_id=ID_TWITCH, oauth_token=TOKEN_TWITCH) twitch_client = TwitchClient(client_id=ID_TWITCH, oauth_token=TOKEN_TWITCH)
chats = dict() chats = dict()
def check_user(name): def check_user(name):
user = twitch_client.users.translate_usernames_to_ids([name]) user = twitch_client.users.translate_usernames_to_ids([name])
if not user: if not user:
@@ -115,4 +113,4 @@ class TwitchCmds(commands.Cog):
def setup(bot): def setup(bot):
bot.add_cog(TwitchCmds(bot)) bot.add_cog(TwitchCmds(bot))
+1 -3
View File
@@ -2,11 +2,9 @@ from private import TOKEN_BOT
from discord.ext import commands from discord.ext import commands
import discord import discord
bot = commands.Bot(command_prefix='$') bot = commands.Bot(command_prefix='$')
startup_extensions = ["cmd_other", "cmd_lol", "cmd_osu", "cmd_twitch"] startup_extensions = ["cmd_other", "cmd_lol", "cmd_osu", "cmd_twitch"]
@bot.event @bot.event
async def on_ready(): async def on_ready():
default_activity = discord.Activity(type=discord.ActivityType.listening, name='$help') default_activity = discord.Activity(type=discord.ActivityType.listening, name='$help')
@@ -20,4 +18,4 @@ if __name__ == "__main__":
bot.load_extension(extension) bot.load_extension(extension)
except Exception as e: except Exception as e:
print(e) print(e)
bot.run(TOKEN_BOT) bot.run(TOKEN_BOT)