Skip to content
This repository was archived by the owner on Oct 4, 2022. It is now read-only.

Commit 7109047

Browse files
authored
Create main.py
1 parent 0297124 commit 7109047

File tree

1 file changed

+275
-0
lines changed

1 file changed

+275
-0
lines changed

RandomMessages/main.py

Lines changed: 275 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,275 @@
1+
# MODIFIED VERSION OF ORIGINAL CODE OF 2/16/2022
2+
# IT IS SUGGESTED YOU USE REPL.IT FOR THIS
3+
# SOME THINGS MAY BE INCORRECT, MAKING BOTS FUN WILL NOT BE LIABLE FOR THIS NOR WILL THE FOUNDER CHAI_RBF BE
4+
5+
import discord
6+
import random
7+
import os
8+
import keep_alive
9+
from discord.ext import commands
10+
from discord_slash.utils import manage_components
11+
from discord_slash.model import ButtonStyle
12+
keep_alive.keep_alive()
13+
client = discord.Client()
14+
bot = commands.Bot(command_prefix='rm!')
15+
@bot.event
16+
async def on_ready():
17+
print('We have logged in as {0.user}'.format(bot))
18+
19+
@bot.event
20+
async def on_message(message):
21+
if message.author == bot.user:
22+
return
23+
24+
@bot.event
25+
async def on_message(message):
26+
await bot.process_commands(message)
27+
return
28+
29+
30+
@bot.command()
31+
@commands.cooldown(2,30,commands.BucketType.user)
32+
async def norrandom(ctx):
33+
norlist = ['Nickel', 'Dime']
34+
embed = discord.Embed(title='Nickel Or Dime', description=random.choice(norlist),color=discord.Color.green())
35+
embed.set_footer(text='The thing you get in the embed does not have any real value of money, this is just a fun command interactive.')
36+
await ctx.send(embed=embed)
37+
38+
39+
@bot.command()
40+
@commands.cooldown(1,500,commands.BucketType.user)
41+
async def suggestions(ctx):
42+
await ctx.send('Suggest here: https://discord.gg/qgZpzUdGgg')
43+
44+
@bot.command()
45+
@commands.cooldown(2,500,commands.BucketType.user)
46+
async def termsofservice(ctx):
47+
buttons =[
48+
manage_components.create_button(
49+
style=ButtonStyle.URL,
50+
label="Terms Of Service",
51+
url='https://sites.google.com/view/randommessages/randommessages-tos'
52+
53+
)
54+
]
55+
embed=discord.Embed(title='Terms Of Service', description='Please click the button below.', color=discord.Color.red())
56+
action_row = manage_components.create_actionrow(*buttons)
57+
await ctx.send(embed=embed, components=[action_row])
58+
59+
@bot.command()
60+
@commands.cooldown(2,500,commands.BucketType.user)
61+
async def privacypolicy(ctx):
62+
buttons =[
63+
manage_components.create_button(
64+
style=ButtonStyle.URL,
65+
label="Privacy Policy",
66+
url='https://sites.google.com/view/randommessages/randommessages-privacy-policy'
67+
68+
)
69+
]
70+
action_row = manage_components.create_actionrow(*buttons)
71+
embed=discord.Embed(title='Privacy Policy', description='Please click the button below.', color=discord.Color.green())
72+
await ctx.send(embed=embed, components=[action_row])
73+
74+
@bot.command()
75+
async def amipro(ctx):
76+
prolist = ['You are Very Pro!', 'You are Pro', 'You are a mega pro']
77+
embed = discord.Embed(title='Pro: Random', description=random.choice(prolist), color=discord.Color.green())
78+
await ctx.send(embed=embed)
79+
80+
@bot.command()
81+
async def credits(ctx):
82+
embed = discord.Embed(title='Credits', description='Credits for bot development, etc', color=discord.Color.green())
83+
embed.add_field(name='<@436312795076886528>', value='Bot Idea got by him')
84+
embed.add_field(name='discord.py', value='Bot Language')
85+
embed.add_field(name='<https://www.youtube.com/watch?v=gamozdALD9I>', value='uptimerobot.com tutorial')
86+
87+
embed.add_field(name='rep.it', value='Hosting & Bot Development Help with definitions of some code')
88+
embed.add_field(name='Status', value='Credit to https://discord.com/channels/81384788765712384/381889733053251584/914196594440667166, credit: <@656919778572632094>')
89+
embed.add_field(name='https://www.youtube.com/watch?v=yeuuB7qiTbQ', value='Embed help')
90+
embed.add_field(name='https://discordpy.readthedocs.io/en/stable/whats_new.html?highlight=timeout', value='Basic Bot Development')
91+
embed.add_field(name='https://stackoverflow.com/questions/54418496/discord-py-how-do-i-send-private-message-to-someone-using-the-persons-id', value='Headstart of direct messages when added, basic base of it')
92+
embed.add_field(name='https://stackoverflow.com/questions/62834161/send-message-to-dms-discord-py', value='Direct Messages Help')
93+
embed.add_field(name='https://www.youtube.com/watch?v=CLQ8gfb2jh4', value='discord.py slash commands tutorial')
94+
embed.add_field(name='<@747386386490851349>', value='rm!randomfact idea')
95+
embed.add_field(name='google', value='rm!prealphanote command for the time in seconds')
96+
embed.add_field(name='https://www.advancedconverter.com/unit-conversions/time-conversion/years-to-seconds', value='Helping convert the year to seconds but seconds to seconds')
97+
embed.add_field(name='https://discord.com/channels/336642139381301249/381965515721146390/932085492953014302 and https://discord.com/channels/336642139381301249/381965515721146390/932085626814222376', value='Helping make hackbot command in premium of RandomMessages - asyncio.sleep()')
98+
embed.add_field(name='https://discord.com/channels/336642139381301249/381965515721146390/932086125273702490', value='Helping make hackbot command in premium of RandomMessages - editing')
99+
embed.add_field(name='https://discord.com/channels/336642139381301249/381965515721146390/932086337044111402', value='Helping make hackbot command in premium of RandomMessages - editing')
100+
embed.add_field(name='https://stackoverflow.com/questions/66510970/add-role-by-id-discord-py', value='Helping with bot event for when users use command, give role if in guild kinda like')
101+
embed.add_field(name='https://stackoverflow.com/questions/49352368/discord-py-delete-author-message-after-executing-command#:~:text=2%20Answers&text=You%20can%20obtain%20the%20message,delete_message%20coroutine%20to%20delete%20messages.', value='Helped with message deletion for the rm!say command')
102+
103+
104+
@bot.command()
105+
async def procommands(ctx):
106+
embed = discord.Embed(title='Pro Commands', description='Random Pro Commands', color = discord.Color.green())
107+
embed.add_field(name='rm!prorandom', value='Sends a random pro message')
108+
embed.add_field(name='rm!amipro', value='Sends a random pro message, all messages sent are basically saying yes')
109+
embed.add_field(name='rm!aminoob', value='All answers say no')
110+
await ctx.send(embed=embed)
111+
112+
@bot.command()
113+
async def prochecker(ctx):
114+
procheckerl = ['You are pro', 'Yes', 'You are']
115+
embed = discord.Embed(title='Pro Checker', description=random.choice(procheckerl), color=discord.Color.green())
116+
await ctx.send(embed=embed)
117+
118+
@bot.command()
119+
async def randomuscoin(ctx):
120+
randomuscoinl = ['Nickel', 'Dime', 'Penny', 'Quarter', 'Half-Dollar Coin']
121+
embed = discord.Embed(title='Random US Coin', description=random.choice(randomuscoinl), color=discord.Color.green())
122+
embed.set_footer(text='The thing you get in the embed does not have any real value of money, this is just a fun command interactive.')
123+
await ctx.send(embed=embed)
124+
125+
@bot.command()
126+
async def moneycommands(ctx):
127+
embed = discord.Embed(title='Money Commands', description='The thing you get in the embed of any of these commands does not have any real value of money, this is just a fun command interactive.', color=discord.Color.green())
128+
embed.add_field(name='rm!randomuscoin', value='Random US coin')
129+
embed.add_field(name='rm!norrandom', value='Nickel or dime command.')
130+
await ctx.send(embed=embed)
131+
132+
@bot.command()
133+
async def moderationcommands(ctx):
134+
await ctx.send('Work in progress')
135+
136+
@bot.command()
137+
async def botdevelopers(ctx):
138+
embed = discord.Embed(title='Bot Developers: RandomMessages', description='Bot Developers of RandomMessages Officially', color=discord.Color.green())
139+
embed.add_field(name='Chai_rbf#9987', value='Bot Development using sources. (see rm!credits for some)')
140+
embed.set_footer(text='Official Bot Developers', icon_url='https://media.discordapp.net/attachments/905518753033371738/921210998411644958/botimg.png?width=422&height=422')
141+
await ctx.send(embed=embed)
142+
143+
@bot.command()
144+
async def botfounder(ctx):
145+
embed = discord.Embed(title='Bot Founder', description='Founder of RandomMessages!', color=discord.Color.green())
146+
embed.add_field(name='Chai_rbf', value='Chai_rbf is the founder of RandomMessages.')
147+
embed.set_footer(text='Official Founder of RandomMessages', icon_url='https://media.discordapp.net/attachments/920449546339893282/931650326405189682/rm_nimg.png?width=422&height=422')
148+
await ctx.send(embed=embed)
149+
150+
151+
@bot.command()
152+
@commands.has_role(920449565633687612)
153+
async def statuschange(ctx):
154+
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name='random commands'))
155+
await ctx.send('Status Change accepted, I assume.')
156+
157+
158+
@bot.command()
159+
async def aminoob(ctx):
160+
aminoobrandom = ['No', 'You are not']
161+
embed = discord.Embed(title='rm!aminoob', description=random.choice(aminoobrandom), color=discord.Color.green())
162+
await ctx.send(embed=embed)
163+
164+
@bot.command()
165+
async def trueorfalse(ctx):
166+
trueorfalse = ['True', 'False']
167+
embed = discord.Embed(title='True Or False', description=random.choice(trueorfalse), color=discord.Color.green())
168+
embed.set_footer(text='NOTICE: This does not represent any real value and this embed entirely is considered a joke for fun purposes. This does not represent anything real and has no value.')
169+
await ctx.send(embed=embed)
170+
171+
@bot.command()
172+
async def timeout(ctx):
173+
timeoutr = ['Nah', 'Sure!', 'No']
174+
embed = discord.Embed(title='Timeout: New Discord Feature, Credit: Discord', description=random.choice(timeoutr), color=discord.Color.red())
175+
embed.set_footer(text='This does not represent a discord action and will not be given. This is for entertainment purposes.')
176+
await ctx.send(embed=embed)
177+
178+
179+
@bot.command()
180+
async def rate5stars(ctx):
181+
r5sl = [':star:', ':star: :star:', ':star: :star: :star:', ':star: :star: :star: :star:', ':star: :star: :star: :star: :star:']
182+
embed = discord.Embed(title='5 Stars: Rated', description=random.choice(r5sl), color=discord.Color.gold())
183+
embed.set_footer(text='This is meant for laughter and entertainment, not cyberbullying or bullying in ANY way. RandomMessages is not responsible for anything illegal happening over the "rm!rate5stars" command.')
184+
await ctx.send(embed=embed)
185+
186+
@bot.command()
187+
async def bugreport(ctx):
188+
embed = discord.Embed(title='Bug Reporting', description='Hey! Bug reporting should be reported in the official support server (https://discord.gg/qgZpzUdGgg). Thank you!', color=discord.Color.green())
189+
await ctx.send(embed=embed)
190+
191+
@bot.command()
192+
async def userreport(ctx):
193+
embed = discord.Embed(title='User Reporting', description='Hey! Reporting users should be reported in the official support server (https://discord.gg/qgZpzUdGgg). RandomMessages currently and may only support right now partnership user reporting. Thank you!', color=discord.Color.green())
194+
await ctx.send(embed=embed)
195+
196+
@bot.command()
197+
async def support(ctx):
198+
embed = discord.Embed(title='Support: RandomMessages', description='Please go to the help discord, the official one, of RandomMessages and ask members first. If the issue is unsolvable by members, please ask developers or staff. Help discord: https://discord.gg/qgZpzUdGgg', color=discord.Color.green())
199+
await ctx.send(embed=embed)
200+
201+
@bot.command()
202+
async def supportcommands(ctx):
203+
embed = discord.Embed(title='Support Category: RandomMessages', description='Support commands for RandomMessages!', color=discord.Color.green())
204+
embed.add_field(name='rm!reportbug', value='Report bugs for RandomMessages!')
205+
embed.add_field(name='rm!reportuser', value='Report users for RandomMessages!')
206+
embed.add_field(name='rm!support', value='N/A')
207+
await ctx.send(embed=embed)
208+
209+
210+
@bot.command()
211+
async def developeronly(ctx):
212+
embed = discord.Embed(title='Developer-Only Commands', description='RandomMessages developer-only!', color=discord.Color.green())
213+
embed.add_field(name='rmdev!status.change',value='Adds bot status')
214+
await ctx.send(embed=embed)
215+
216+
@bot.command()
217+
async def randomfact(ctx):
218+
rfrm = ['A developer of RandomMessages has wrote this message!', 'You are alive.', 'A pro is you.', '{} rocks!'.format(ctx.author.mention)]
219+
embed = discord.Embed(title='Random Fact', description='Random fact: {}'.format(random.choice(rfrm)), color=discord.Color.green())
220+
embed.set_footer(text='Random Fact')
221+
await ctx.send(embed=embed)
222+
223+
@bot.command()
224+
async def moderation(ctx):
225+
embed = discord.Embed(title='Moderation: RandomMessages', description='Moderation commands!', color=discord.Color.red())
226+
embed.add_field(name='rm!timeout', value='The new discord timeout feature - this does not perform a real discord action')
227+
await ctx.send(embed=embed)
228+
229+
@bot.command()
230+
async def funcommands(ctx):
231+
embed = discord.Embed(title='Fun Commands', description='Fun commands, in general!', color=discord.Color.green())
232+
embed.add_field(name='rm!rate5stars', value='Rates out of 5 stars! Command has a notice, please read.')
233+
embed.add_field(name='rm!trueorfalse', value='Says if something is true or false! Command has a notice, please read.')
234+
await ctx.send(embed=embed)
235+
236+
237+
@bot.command()
238+
async def supportserver(ctx):
239+
buttons= [
240+
manage_components.create_button(
241+
style=ButtonStyle.URL,
242+
label="Support Server", url="https://discord.gg/qgZpzUdGgg"
243+
)
244+
]
245+
action_row = manage_components.create_actionrow(*buttons)
246+
await ctx.send("Hey! Please click the button below for the link to the support server for now.", components=[action_row])
247+
248+
@bot.command()
249+
@commands.has_any_role(927294248208990219, 927294287488639036)
250+
async def staffpro(ctx):
251+
staffprolist = [f'you are very pro, {ctx.author.mention}!', f'{ctx.author.mention}, you are pro..', f'N/A, {ctx.author.mention} !', f'somewhat pro, {ctx.author.mention}']
252+
embed = discord.Embed(title=f'Are you pro: Staff version?', description=f'seems like {random.choice(staffprolist)}', color=discord.Color.green())
253+
await ctx.send(embed=embed)
254+
255+
@bot.command()
256+
@commands.has_role(923224503843180604)
257+
@commands.cooldown(1,31556926.000001, commands.BucketType.user)
258+
async def prealphanote(ctx):
259+
embed = discord.Embed(title='To YOU,', description='Thank you for being a person who supported RandomMessages through the early times of the bot and times wherein the bot was not verified and was not in a lot of servers. You trusted RandomMessages and used it although it could have been a scam. Thank you.', color=discord.Color.green())
260+
embed.set_footer(text='Mostly by, - Chai_rbf')
261+
await ctx.author.send(embed=embed)
262+
263+
@bot.command()
264+
@commands.has_role(920449615118090270)
265+
async def say(ctx, *, arg):
266+
await ctx.message.delete()
267+
await ctx.send(arg)
268+
269+
@bot.command()
270+
@commands.has_role(920449615118090270)
271+
async def dm(ctx, user : discord.User, *, arg):
272+
await user.send(f"A message has been sent to you by {ctx.author.mention} saying: {arg}")
273+
274+
275+
bot.run('YOUR_TOKEN_HERE')

0 commit comments

Comments
 (0)