Skip to content

Instantly share code, notes, and snippets.

Avatar
📄
Coding

Joshua Busacker aikocc

📄
Coding
View GitHub Profile
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()
@aikocc
aikocc / custom_role_cog.py
Created Oct 12, 2020
Code from Oct 26, 2019
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()
@aikocc
aikocc / bot.py
Created Jun 13, 2020
Give roles on going Live on twitch
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: