View cog_downloader.py
from discord.ext import commands | |
class CogDownloader(commands.Cog) | |
def __init__(self, bot): | |
self.bot = bot | |
@commands.command(aliases=['dlcog']) | |
@commands.is_owner() |
View custom_role_cog.py
import discord | |
from discord.ext import commands | |
from discord.ext.commands import has_permissions | |
import sqlite3 | |
conn = sqlite3.connect('.\customroles.db') | |
c = conn.cursor() | |
c.execute('''CREATE TABLE IF NOT EXISTS "custom_role" | |
(server_id INTEGER NOT NULL, user TEXT NOT NULL, user_id INTEGER NOT NULL, role TEXT NOT NULL, role_id INTEGER NOT NULL)''') | |
conn.commit() |
View bot.py
import discord | |
from discord.ext import commands | |
bot = commands.Bot(command_prefix='?') | |
@bot.event | |
async def on_member_update(before, after): | |
streaming_role = after.guild.get_role(<replace this>) | |
if after.activity is discord.Streaming: | |
if not streaming_role in after.roles: |