forked from Darkempire78/Raid-Protect-Discord-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
40 lines (30 loc) · 1018 Bytes
/
main.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
#!/usr/bin/env python3
import discord
import os
import json
from discord.ext import commands
class Greetings(commands.Cog):
def __init__(self, bot):
self.bot = bot
self._last_member = None
intents = discord.Intents.default()
intents.members = True
bot = commands.Bot("?", intents = intents)
# bot = commands.when_mentioned_or("?")
# HELP
bot.remove_command("help") # To create a personal help command
# Load cogs
if __name__ == '__main__':
for filename in os.listdir("Cogs"):
if filename.endswith(".py"):
bot.load_extension(f"Cogs.{filename[:-3]}")
@bot.event
async def on_ready():
print(f'We have logged in as {bot.user}')
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name =f"{bot.command_prefix}help"))
print(discord.__version__)
# ------------------------ RUN ------------------------ #
with open("configuration.json", "r") as config:
data = json.load(config)
token = data["token"]
bot.run(token)