-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinfdev.py
74 lines (65 loc) · 2.47 KB
/
infdev.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
import discord
from discord.ext import commands
from atproto import Client # type: ignore
import json
import pretty_help
from pretty_help import PrettyHelp
import datetime
initial_extensions = (
"cogs.bluesky",
"cogs.random",
"cogs.gamble",
"cogs.youtube",
"cogs.twitter",
"cogs.e",
"cogs.hypixel",
"cogs.voice",
"cogs.tag",
"cogs.fbridge",
"cogs.schedule",
"cogs.weather",
)
description = '''Hello.
There are a number of utility commands being showcased here.
co-developped by donotsolveme
(I illegally steal codes from various people)
(including donotsolveme)'''
# チャンネル指定
Manage_Channel = 1273134816308625439
# ずんだもん
zunda = 'https://i.imgur.com/6bgRNLR.png'
# help
# embedの下の文字
ending_note = "Pasted by Satt \nFor help: {help.clean_prefix}{help.invoked_with}"
class MyBot(commands.Bot):
def __init__(self):
intents = discord.Intents.all()
super().__init__(command_prefix='*',
description=description,
intents=intents,
help_command=PrettyHelp(menu=pretty_help.AppMenu(),
index_title="Do you need any help?",
color= 0x191919,
ending_note=ending_note,
thumbnail_url=zunda,
send_typing=False,
sort_commands=True
)
) # ここにcommands.Botで使ってたパラメータを入れる
async def setup_hook(self) -> None: # ログインする前に実行されるイベント
await bot.load_extension("jishaku")
for extension in initial_extensions:
try:
await self.load_extension(extension)
except Exception as e:
print(e)
print(f"Failed to load extension {extension}.")
async def on_ready(self):
print(f'Logged in as {self.user.name}#{self.user.discriminator} ({self.user.id})')
channel = bot.get_channel(Manage_Channel)
await channel.send(f'The Bot is up! @ {datetime.datetime.now().strftime("%H:%M:%S")}')
bot = MyBot()
bot_token = ''
with open("data/!important/bot_token.json", "r", encoding="utf-8") as f:
bot_token = json.load(f)
bot.run(bot_token)