1
Fork 0
mirror of https://github.com/RGBCube/minearchy-bot synced 2025-07-27 08:57:46 +00:00

Merge pull request #2 from RGBCube/main

Main
This commit is contained in:
RGBCube 2022-06-21 13:02:57 +03:00 committed by GitHub
commit b118f6ea20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 12 deletions

11
bot.py
View file

@ -18,11 +18,9 @@ class MinearchyBot(commands.Bot):
log_webhook: discord.Webhook log_webhook: discord.Webhook
up_ts: float up_ts: float
embed_color = 0x3500FF embed_color = 0x2C65FF
def __init__( def __init__(self, *, token: str, webhook_url: str) -> None:
self, *, token: str, webhook_url: str, suggestions_channel_id: int
) -> None:
ip = "play.landsofminearchy.com" ip = "play.landsofminearchy.com"
self.mc_server = mcstatus.JavaServer.lookup(ip) self.mc_server = mcstatus.JavaServer.lookup(ip)
self.mc_server.ip = ip self.mc_server.ip = ip
@ -30,10 +28,9 @@ class MinearchyBot(commands.Bot):
self.token = token self.token = token
self.webhook_url = webhook_url self.webhook_url = webhook_url
self.suggestions_channel_id = suggestions_channel_id
super().__init__( super().__init__(
command_prefix="=", command_prefix="=",
owner_ids=set([512640455834337290]), owner_ids={512640455834337290},
intents=discord.Intents( intents=discord.Intents(
guilds=True, guilds=True,
members=True, members=True,
@ -52,7 +49,7 @@ class MinearchyBot(commands.Bot):
async def on_ready(self) -> None: async def on_ready(self) -> None:
self.up_ts = time.time() self.up_ts = time.time()
self.suggestions_channel = self.get_channel(self.suggestions_channel_id) self.suggestions_channel = self.get_channel(955972394885984276)
print(f"\nConnected to Discord!\nUser: {self.user}\nID: {self.user.id}") print(f"\nConnected to Discord!\nUser: {self.user}\nID: {self.user.id}")
await self.log_webhook.send("Bot is now online!") await self.log_webhook.send("Bot is now online!")

View file

@ -1,8 +1,4 @@
{ {
"BEDROCK_IP": "bedrock.landsofminearchy.com",
"JAVA_IP": "play.landsofminearchy.com",
"BOT_PREFIX": "=",
"BOT_TOKEN": "XXX(ENV works too)", "BOT_TOKEN": "XXX(ENV works too)",
"WEBHOOK_URL": "XXX(ENV works too)", "WEBHOOK_URL": "XXX(ENV works too)"
"SUGGESTIONS_CHANNEL_ID": 955972394885984276
} }