-
Notifications
You must be signed in to change notification settings - Fork 0
/
partly.py
80 lines (65 loc) · 2.16 KB
/
partly.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import discord
from discord.ext import commands
import asyncio
import aiohttp
import random
import logging
import os
token= ""
if not discord.opus.is_loaded():
discord.opus.load_opus()
cogs = ['cogs.music',
'cogs.fun',
'cogs.media',
'cogs.shitposts']
bot = commands.Bot(command_prefix="p+", description="A bot that does stuff. By SIX10#0877.")
@bot.event
async def on_ready():
print("Logged in as")
print(bot.user.name)
print(bot.user.id)
print("-----------")
await bot.change_presence(activity=discord.Game(name="with yo girl | p+commands "))
for cog in cogs:
bot.load_extension(cog)
@bot.command()
async def invite(ctx):
msg = discord.Embed(title="Invite",
description="You can invite me to your server with https://discordapp.com/oauth2/authorize?client_id=447940688508878868&scope=bot&permissions=0",
color=discord.Color.red())
await ctx.send(embed=msg)
@bot.command()
async def servers(ctx):
msg = "Connected to " + str(len(bot.guilds)) + " servers"
await ctx.send(msg)
@bot.command()
async def users(ctx):
msg = "Serving " + str(len(bot.users)) + " users"
await ctx.send(msg)
@bot.command()
async def bug(ctx):
await ctx.send("Found a bug? Report it to https://discord.gg/7KWqhzb or message SIX10#0877")
@bot.command(hidden=True)
async def listservers(ctx):
if ctx.author.id == 130853292275269632:
msg = "Connected to " + str(bot.guilds)
await ctx.send (msg)
@bot.command(hidden=True)
async def quit(ctx):
if ctx.author.id == 130853292275269632:
await ctx.send("Shutting down...")
await bot.logout()
@bot.command()
async def ping(ctx):
await ctx.send(f"Pong! Responded in {round(bot.latency*1000, 2)} ms")
@bot.command(name='reload', hidden=True)
async def cog_reload(self, ctx, *, cog: str):
if ctx.author.id == 130853292275269632:
try:
self.bot.unload_extension(cog)
self.bot.load_extension(cog)
except Exception as e:
await ctx.send(f'**`ERROR:`** {type(e).__name__} - {e}')
else:
await ctx.send('**`SUCCESS`**')
bot.run(token)