-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
139 lines (112 loc) · 3.95 KB
/
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
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import discord
import asyncio
from dotenv import load_dotenv
from discord import app_commands
from discord.ext import commands
from pytz import timezone
from datetime import datetime
from datetime import date
import random
import os
load_dotenv()
intents = discord.Intents.all()
intents.members = True
client = commands.Bot(command_prefix="f!", intents=intents, case_insensitive=True)
TOKEN = os.getenv("secret_token")
tz = timezone("EST")
datetime.now(tz)
@client.command()
async def ping(ctx):
pingEmbed = discord.Embed(color=0x6B31A5, timestamp=datetime.now())
pingEmbed.add_field(
name="**Pong!**",
value=f"Latency: {round(client.latency * 1000)}ms",
inline=False,
)
pingEmbed.set_footer(
text=f"Requested by {ctx.author.name}", icon_url=ctx.author.display_avatar
)
await ctx.send(embed=pingEmbed)
@client.command()
async def whois(ctx, member: discord.Member):
userInfoEmbed = discord.Embed(
title=f"User info for {member.name}",
description=member.mention,
color=member.color,
timestamp=datetime.now(),
)
userInfoEmbed.add_field(name="**ID:**", value=member.id, inline=False)
userInfoEmbed.add_field(
name="**Created At:**", value=str(member.created_at)[0:9], inline=False
)
userInfoEmbed.add_field(
name="**Roles:**",
value=" ".join(
[role.mention for role in member.roles if role.name != "@everyone"]
),
inline=False,
)
userInfoEmbed.set_thumbnail(url=member.display_avatar)
userInfoEmbed.set_footer(
text=f"Requested by {ctx.author.name}", icon_url=ctx.author.display_avatar
)
await ctx.send(embed=userInfoEmbed)
@client.command()
async def contributors(ctx):
contribEmbed = discord.Embed(
title="Contributors", color=0x6B31A5, timestamp=datetime.now()
)
contribEmbed.add_field(
name="Lead Developer",
value="<:discord:1195074703837102121> sm.it\n<:githubwhite:1195075097678065705> smit4k\n<:twitch:1195073396283801651> smitfps",
inline=False,
)
contribEmbed.add_field(name="Developers", value="Placeholder", inline=False)
contribEmbed.add_field(name="Testers", value="<@807555025634983967>", inline=False)
contribEmbed.set_footer(
text=f"Requested by {ctx.author.name}", icon_url=ctx.author.display_avatar
)
await ctx.send(embed=contribEmbed)
@client.command()
async def source(ctx):
soEmbed = discord.Embed(title="Falkon Source Code", color=0x6B31A5)
soEmbed.add_field(
name="GitHub", value="https://www.github.com/smit4k/Falkon-Bot", inline=False
)
soEmbed.set_footer(
text=f"Requested by {ctx.author.name}", icon_url=ctx.author.display_avatar
)
await ctx.send(embed=soEmbed)
@client.command()
async def suggest(ctx):
suEmbed = discord.Embed(title="Suggest a feature", color=0x6B31A5)
suEmbed.add_field(name="Google Forms", value="https://forms.gle/kPo3Ma17BjtC6rW18")
suEmbed.set_footer(
text=f"Requested by {ctx.author.name}", icon_url=ctx.author.display_avatar
)
await ctx.send(embed=suEmbed)
@client.command()
async def bugs(ctx):
bugEmbed = discord.Embed(title="Known bugs", color=0x6B31A5)
bugEmbed.add_field(name="Command not working", value="stocks/stockprice")
bugEmbed.set_footer(
text=f"Requested by {ctx.author.name}", icon_url=ctx.author.display_avatar
)
await ctx.send(embed=bugEmbed)
@client.event
async def on_ready():
await client.change_presence(
activity=discord.Streaming(
name="prefix is f!", url="https://www.twitch.tv/smitfps"
)
)
print("BOT IS ONLINE!\nSigned in as " + client.user.name)
async def load():
for filename in os.listdir("./cogs"):
if filename.endswith(".py"):
await client.load_extension(f"cogs.{filename[:-3]}")
async def main():
await load()
await client.start(TOKEN)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())