This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from discord.ext import commands | |
class CogDownloader(commands.Cog) | |
def __init__(self, bot): | |
self.bot = bot | |
@commands.command(aliases=['dlcog']) | |
@commands.is_owner() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |