26 lines
699 B
Python
26 lines
699 B
Python
import discord
|
|
from discord.ext import commands
|
|
import sqlite3
|
|
|
|
class Basic(commands.Cog):
|
|
|
|
def __init__(self,client):
|
|
self.client = client
|
|
|
|
@commands.command()
|
|
async def ping(self, ctx):
|
|
await ctx.send("pong!")
|
|
|
|
@commands.command()
|
|
@commands.guild_only()
|
|
@commands.has_permissions(manage_messages=True)
|
|
async def changeprefix(self, ctx, *, prefix):
|
|
conn = sqlite3.connect('./db.sqlite3')
|
|
curr = conn.cursor()
|
|
curr.execute(f'UPDATE guilds SET prefix = "{prefix}" WHERE guild_id = "{ctx.guild.id}"')
|
|
conn.commit()
|
|
await ctx.send(f"Prefix changed to `{prefix}`")
|
|
|
|
def setup(client):
|
|
client.add_cog(Basic(client))
|