Skip to content

Instantly share code, notes, and snippets.

View aikocc's full-sized avatar
📄
Coding

Aiko aikocc

📄
Coding
View GitHub Profile
from discord.ext import commands
class CogDownloader(commands.Cog)
def __init__(self, bot):
self.bot = bot
@commands.command(aliases=['dlcog'])
@commands.is_owner()
@aikocc
aikocc / custom_role_cog.py
Created October 12, 2020 20:36
Code from Oct 26, 2019
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()
@aikocc
aikocc / bot.py
Created June 13, 2020 02:48
Give roles on going Live on twitch
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: