Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
27494de
add goof
Jul 28, 2017
4b22c54
Merge pull request #13 from FireEmblemUniverse/goof
boviex Jul 28, 2017
0daaee5
Merge pull request #14 from FireEmblemUniverse/ree
boviex Jul 28, 2017
b1f32b6
Undelete functionality
Jul 30, 2017
f41cb7f
fix spaces
Jul 30, 2017
94ecff5
per channel
Jul 31, 2017
47b9d32
Merge pull request #17 from FireEmblemUniverse/undelete
boviex Jul 31, 2017
66fe656
added goof
boviex Aug 4, 2017
e43dd58
ew jeorge
boviex Aug 8, 2017
70da9a2
wtfdyjfsamylb
boviex Aug 30, 2017
14d828c
new goofs and such
boviex Sep 5, 2017
c9b5f74
!orbit
boviex Sep 6, 2017
c76f3eb
Aliased incredible.
Crazycolorz5 Sep 12, 2017
1c6059f
Edited undelete. last returns a list. Always prints author of each me…
Crazycolorz5 Sep 12, 2017
ef6e59c
Merge pull request #18 from FireEmblemUniverse/incredible
boviex Sep 12, 2017
256faa2
Fixed issues, made author tracking work. TODO: Remove the number para…
Crazycolorz5 Sep 15, 2017
3662ab8
Added fEU Patreon to donate command.
Crazycolorz5 Sep 15, 2017
ab5a476
Merge pull request #19 from FireEmblemUniverse/undelete
boviex Sep 15, 2017
8966293
Merge pull request #20 from FireEmblemUniverse/donate
boviex Sep 15, 2017
07586b6
reeg
boviex Sep 16, 2017
4765557
masomethinga
boviex Sep 17, 2017
140da2b
whois bm
boviex Oct 7, 2017
4f0e8b0
beat
boviex Oct 23, 2017
59137e6
Added slow command.
Crazycolorz5 Oct 26, 2017
e60f7cd
Merge pull request #21 from FireEmblemUniverse/slow
boviex Oct 26, 2017
3be0930
keriku
boviex Nov 14, 2017
6e2b1e0
tethys and marisa
boviex Nov 28, 2017
65ea976
fix waifu
boviex Dec 2, 2017
9f2852a
handcuff
boviex Dec 9, 2017
1861794
Added loki ew.
Crazycolorz5 Jan 1, 2018
5e7f3a2
Merge pull request #22 from FireEmblemUniverse/personality-ew
boviex Jan 3, 2018
fe0338b
Added evil command. Evil must be eliminated.
Crazycolorz5 Jan 12, 2018
56cc1b3
Fixed typo.
Crazycolorz5 Jan 12, 2018
4ae6a05
Made it work.
Crazycolorz5 Jan 12, 2018
e771315
Merge branch 'master' into Evil
Crazycolorz5 Jan 12, 2018
1e6dce4
Merge pull request #23 from FireEmblemUniverse/Evil
boviex Jan 12, 2018
d0f2e57
lel
boviex Jan 25, 2018
3f32140
approval
boviex Jan 26, 2018
32815d5
approve2
boviex Jan 26, 2018
7634899
only i may approve
boviex Jan 26, 2018
9b34cae
one more try
boviex Jan 26, 2018
7772e9d
lel2
boviex Feb 1, 2018
2d0be41
stalkers goof
boviex Feb 4, 2018
50fefba
ok
boviex Feb 7, 2018
d313fce
uberthink
boviex Feb 10, 2018
8d5fd9b
default approve
boviex Feb 14, 2018
cc1a977
new seal 4 letha
boviex Feb 14, 2018
0ae2310
reee2
boviex Feb 16, 2018
0841145
reee
boviex Feb 16, 2018
77d5e65
candy
boviex Feb 19, 2018
d7fc7ae
more goof
boviex Feb 19, 2018
6866ec4
brat
Feb 20, 2018
ab6ac3e
orbs
CT075 Feb 20, 2018
fba98a4
update timer to avoid spam
Feb 20, 2018
d40aa19
wtf
Feb 20, 2018
35e1894
boring fix
boviex Feb 20, 2018
6ba6ef2
artifact
boviex Feb 20, 2018
4d1ac08
creepy
boviex Feb 21, 2018
c824acc
new goof
boviex Feb 23, 2018
3fe8df7
ports lol
boviex Feb 24, 2018
16af48c
fix?
boviex Feb 24, 2018
19b4ec1
Revert "fix?"
boviex Feb 24, 2018
814ddd4
Revert "ports lol"
boviex Feb 24, 2018
1136332
ports but for real this time
boviex Feb 24, 2018
a1e1b98
anim repo
boviex Feb 27, 2018
48ea4d1
HARD
boviex Feb 27, 2018
4760998
owt
boviex Feb 28, 2018
31c0ed3
update
boviex Mar 2, 2018
e788ee7
yetirepo
boviex Mar 5, 2018
b05af8e
no more port
boviex Mar 7, 2018
7e60ac8
repo update
boviex Mar 18, 2018
2ade5cb
updated repo again
boviex Mar 19, 2018
3007f43
oops
boviex Mar 19, 2018
afecf66
Removed pycache
Crazycolorz5 Mar 25, 2018
c97b198
Added prostitute goof
Crazycolorz5 Mar 25, 2018
f406eca
Merge pull request #24 from FireEmblemUniverse/prostitute
boviex Mar 26, 2018
2be59ee
Made permissions a bit more robust and began work on dynamic commands.
Crazycolorz5 Apr 13, 2018
81b32e1
Made permissions a bit more robust and began work on dynamic commands.
Crazycolorz5 Apr 13, 2018
b7efeb6
Revert "Made permissions a bit more robust and began work on dynamic …
Crazycolorz5 Apr 13, 2018
255debb
Made undelete permissions tied to undeleter role or mod pivileges.
Crazycolorz5 Apr 13, 2018
10ebd99
Got adding commands working how I want.
Crazycolorz5 Apr 13, 2018
34338d5
Finished command permissions and saving/loading commands.
Crazycolorz5 Apr 13, 2018
0bd7cf9
Debugged file saving/loading.
Crazycolorz5 Apr 13, 2018
9ccece1
Made commands recognize only circs/colorz/cam for filesystem safety.
Crazycolorz5 Apr 13, 2018
f293c23
Fixed undeleting (somehow channel accessor got deleted)
Crazycolorz5 Apr 13, 2018
dca91c6
Merge pull request #25 from FireEmblemUniverse/betterPerms
boviex Apr 13, 2018
0c2a2ab
Fixed developer permissions, added error handling.
Crazycolorz5 Apr 13, 2018
d407738
Merge pull request #26 from FireEmblemUniverse/betterPerms
boviex Apr 13, 2018
44b637b
Changed error handler.
Crazycolorz5 Apr 13, 2018
575b579
Added hidden debug command (for developers) and fixed error handling …
Crazycolorz5 Apr 16, 2018
b35cdee
Made debug/exec more robust (ignores quit()), and added way to dynami…
Crazycolorz5 Apr 16, 2018
2ae2817
Merge pull request #27 from FireEmblemUniverse/removeCommandFix
boviex Apr 16, 2018
486c223
Moved debug into no category so removing the other cog doesn't lock o…
Crazycolorz5 Apr 16, 2018
a0e6ed8
Merge pull request #28 from FireEmblemUniverse/removeCommandFix
boviex Apr 16, 2018
0ea558b
Fixed undelete permissions, moved event registration for message dele…
Crazycolorz5 Apr 17, 2018
56cba19
Merge pull request #29 from FireEmblemUniverse/undeleteFix
boviex Apr 17, 2018
2f72dd7
Added rollDie/die command. Simple wrapper for randrange
Crazycolorz5 Apr 19, 2018
8f3bba8
Merge pull request #30 from FireEmblemUniverse/rollDie
boviex Apr 19, 2018
cd1b1db
Update helpful.py
Crazycolorz5 Apr 19, 2018
9e14c57
Merge pull request #31 from FireEmblemUniverse/rollDie
boviex Apr 19, 2018
f226672
ew eph
boviex Apr 23, 2018
8af4f8d
Try context creation.
Crazycolorz5 Jul 17, 2018
15aa951
Remove debug echo of command name.
Crazycolorz5 Jul 17, 2018
0f6d5ea
Merge pull request #32 from FireEmblemUniverse/otherfix
boviex Jul 17, 2018
4d6ed03
Add goof goof.
Crazycolorz5 Jul 20, 2018
253f464
Merge pull request #33 from FireEmblemUniverse/goofgoof
boviex Jul 29, 2018
274a571
metagoof
boviex Nov 9, 2018
5fd2e6f
Fixed whois bm to exit after posting the gif.
Crazycolorz5 Jan 20, 2019
345ca37
Merge pull request #35 from FireEmblemUniverse/bmfix
boviex Jan 20, 2019
7808aa8
add goof
boviex Mar 11, 2019
ad26448
new goof
boviex Mar 12, 2019
9e7203e
Add !colorz
Kirbseverywhere Oct 6, 2019
4ce96e2
added !awful
runadoesathing Oct 16, 2019
863a27d
indenting mistake
runadoesathing Oct 16, 2019
dc1650a
Update reactions.py
runadoesathing Oct 16, 2019
c826632
Add mod command.
Crazycolorz5 Nov 5, 2019
9c81a56
Made the command work.
Crazycolorz5 Nov 5, 2019
b901abd
Added a how to ask for moderation.
Crazycolorz5 Nov 5, 2019
4a35d97
Allow for spaces in a descriptor.
Crazycolorz5 Nov 5, 2019
dbd4b8f
Improved descriptions.
Crazycolorz5 Nov 5, 2019
ac5b19b
Merge pull request #39 from FireEmblemUniverse/mod
boviex Nov 5, 2019
47bdd52
Remove failure to delete error in PMs, updated description.
Crazycolorz5 Nov 6, 2019
319ece7
Added <> around !mod messages to remove embeds
Crazycolorz5 Nov 26, 2019
862a033
Merge pull request #40 from FireEmblemUniverse/Crazycolorz5-patch-1
boviex Nov 26, 2019
268ba27
Reroute mod messages to response channel.
Crazycolorz5 Dec 10, 2019
4a523ef
Update helpful.py
Crazycolorz5 Dec 10, 2019
80816a5
Merge pull request #41 from FireEmblemUniverse/helpful
boviex Dec 14, 2019
ce1b8d3
Update helpful.py
Crazycolorz5 Jan 25, 2020
0aa99bb
Merge pull request #42 from FireEmblemUniverse/emblem-anims
boviex Jan 25, 2020
c63c2f1
Merge pull request #38 from runadoesathing/awful
boviex Jan 25, 2020
8b20384
Merge pull request #36 from Kirbseverywhere/master
boviex Jan 25, 2020
6cd364a
add goof porn.png
boviex May 16, 2020
89d96e6
Make command loading not blow up on exception.
Crazycolorz5 May 31, 2020
d8b5396
back from the dead?
boviex Aug 9, 2021
3166114
oops
boviex Aug 9, 2021
121e002
one more try
boviex Aug 9, 2021
3c4ca46
simpler help
boviex Aug 9, 2021
ce88171
fixed reactions
boviex Aug 10, 2021
f5b05ce
dm_help
boviex Aug 10, 2021
89bdf93
fixed other, included commands pickle
boviex Aug 11, 2021
7e1d00f
cloud backup of commands
boviex Aug 11, 2021
31d2a0c
donate link
boviex Oct 16, 2021
32409de
added !s alias
boviex Oct 23, 2021
14e9b0c
fix hubba
boviex Oct 23, 2021
5236fdd
createwaifu returns
boviex Oct 25, 2021
aff2581
fix reee
boviex Nov 10, 2021
0ccd574
allow feubot to give soldier if it has conscripter role
boviex Dec 29, 2021
1e31a87
Add role reactions for base_conversation roles
masterofcontroversy May 7, 2022
f5dbbda
role system overhaul
masterofcontroversy May 22, 2022
25e58c7
Error handling for no role reactions. Rename delete_role and delete_r…
masterofcontroversy May 22, 2022
b81b02e
Error handling for bad messageIDs
masterofcontroversy May 22, 2022
b2e850b
Revert developerIDs
masterofcontroversy May 22, 2022
791fd43
Merge pull request #44 from masterofcontroversy/master
boviex May 22, 2022
8e61f01
Error handling for reaction roles during listReactionRoles
masterofcontroversy May 22, 2022
9f6c98b
Make listReactionRoles loop through channels to find links
masterofcontroversy May 26, 2022
b18da7f
Add guard clause in listReactionRoles
masterofcontroversy May 26, 2022
dbb212b
Add cloud role storage with cloudinary
masterofcontroversy May 27, 2022
8779378
Merge pull request #45 from masterofcontroversy/master
boviex May 27, 2022
770f29a
Error handling for no reaction role file in cloud, revert developer list
masterofcontroversy May 27, 2022
733aa6b
Change role file name back
masterofcontroversy May 27, 2022
23f09f0
Merge pull request #46 from masterofcontroversy/master
boviex May 27, 2022
13071d7
Add message property functionality
masterofcontroversy Jul 3, 2022
5b76dee
rename roles.py to messageManager.py
masterofcontroversy Jul 3, 2022
eaea0ba
add newline to end of messageManager.py
masterofcontroversy Jul 3, 2022
e2281d4
Add exception handling for 403 errors
masterofcontroversy Jul 21, 2022
ff03681
Merge pull request #47 from masterofcontroversy/master
CT075 Jul 21, 2022
fb520fb
fix coroutine 'BotBase.add_cog' was never awaited
boviex Dec 1, 2022
5b1ef79
add async
boviex Dec 1, 2022
e9d32cd
one more
boviex Dec 1, 2022
1d3e89f
Update feubot.py
boviex Dec 1, 2022
b78256e
Revert "Update feubot.py"
boviex Dec 1, 2022
82cea5b
test
boviex Dec 1, 2022
736885a
betterfix
boviex Dec 1, 2022
e934330
Update reactions.py
boviex Feb 3, 2023
9a13695
Update reactions.py
boviex Feb 3, 2023
a57c149
allow typo soldier variants
boviex Mar 5, 2024
13a4acc
remove broken repository command
boviex Jun 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ Temporary Items
#login details
token
clientid
clcreds
Binary file added BMis.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FEU_Seal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Letha_Seal_of_Approval.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Tikis_in_orbit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed __pycache__/feubotFormatter.cpython-35.pyc
Binary file not shown.
Binary file added __pycache__/helpful.cpython-310.pyc
Binary file not shown.
Binary file removed __pycache__/helpful.cpython-35.pyc
Binary file not shown.
Binary file added __pycache__/helpful.cpython-39.pyc
Binary file not shown.
Binary file added __pycache__/memes.cpython-310.pyc
Binary file not shown.
Binary file removed __pycache__/memes.cpython-35.pyc
Binary file not shown.
Binary file added __pycache__/memes.cpython-39.pyc
Binary file not shown.
Binary file added __pycache__/messageManager.cpython-310.pyc
Binary file not shown.
Binary file removed __pycache__/mycog.cpython-35.pyc
Binary file not shown.
Binary file added __pycache__/other.cpython-310.pyc
Binary file not shown.
Binary file added __pycache__/other.cpython-39.pyc
Binary file not shown.
Binary file added __pycache__/reactions.cpython-310.pyc
Binary file not shown.
Binary file removed __pycache__/reactions.cpython-35.pyc
Binary file not shown.
Binary file added __pycache__/reactions.cpython-39.pyc
Binary file not shown.
Binary file removed __pycache__/useful.cpython-35.pyc
Binary file not shown.
Binary file added approved.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added awful.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands.pickle
Binary file not shown.
Binary file added commands_backup.pickle
Binary file not shown.
Binary file added creepy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added disgusting/ephraim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added disgusting/jedah.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added disgusting/jeorge.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added disgusting/loki.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added disgusting/shigure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
131 changes: 119 additions & 12 deletions feubot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,144 @@
import random
import os
from sys import argv
# from feubotFormatter import FeubotFormatter
from discord.ext.commands import DefaultHelpCommand

import messageManager as msgManager

async def setupBot(bot):
import helpful, memes, reactions, other#, undelete
await reactions.setup(bot)
await memes.setup(bot)
await helpful.setup(bot)
# undelete.setup(bot)
await other.setup(bot)
#TODO: Stuff like bot.other = bot.get_cog("Other") and such. Then initialize debug's "self" to be bot.

bot.remove_command('debug')
#Reload this as part of reload due to use of other.developerCheck
@bot.command(pass_context=True, hidden = True, aliases = ['exec'])
@other.developerCheck
async def debug(ctx, *, arg):
# https://stackoverflow.com/questions/3906232/python-get-the-print-output-in-an-exec-statement
from io import StringIO
import sys
old_stdout = sys.stdout
redirected_output = sys.stdout = StringIO()
bot = ctx.bot
try:
exec(arg)
except SystemExit:
await bot.send("I tried to quit().")
finally:
sys.stdout = old_stdout
output = redirected_output.getvalue()
output = "No output." if not output else output
await bot.send(output)

import helpful, memes, reactions
from feubotFormatter import FeubotFormatter

if __name__ == "__main__":

intents = discord.Intents.all()
intents.members = True

if "--debug" in argv:
bot = commands.Bot(command_prefix=['##', 'feubeta '], description='this is feubot beta.', formatter = FeubotFormatter())
bot = commands.Bot(command_prefix=['##', 'feubeta '], description='this is feubot beta.', intents=intents, help_command = DefaultHelpCommand(dm_help=True))
else:
bot = commands.Bot(command_prefix=['!', '>>', 'feubot '], description='this is feubot.', formatter = FeubotFormatter())
bot = commands.Bot(command_prefix=['!', '>>', 'feubot '], description='this is feubot.', intents=intents, help_command = DefaultHelpCommand(dm_help=True))

@bot.event
async def on_ready():
await setupBot(bot)
print('Logged in as')
print(bot.user.name)
print(bot.user.id)
print('------')
await bot.change_presence(game=discord.Game(name="Reading the doc!"))
await bot.change_presence(activity=discord.Game(name="Reading the doc!"))

@bot.event
async def on_raw_reaction_add(payload):
messageID = payload.message_id
reaction = payload.emoji.name
role_name = msgManager.find_role(str(messageID), reaction)
msg_properties = msgManager.get_properties(str(messageID))

guild = bot.get_guild(payload.guild_id)
member = payload.member
role = discord.utils.get(guild.roles, name=role_name)

#Extra check for management uses
if member == guild.owner and "ignoreOwner" in msg_properties:
print("Ignoring owner")
return

if role:
#If roles are exclusive, remove all other roles from the user
if "exclusiveRoles" in msg_properties:
reactRoles = msgManager.load_roles()[str(messageID)].values()
for x in member.roles:
if x.name in reactRoles:
await member.remove_roles(x)

#Remove other reactions on the message from this user
message = await guild.get_channel(payload.channel_id).fetch_message(messageID)
for x in message.reactions:
if x.emoji != reaction:
await x.remove(member)

await member.add_roles(role)

@bot.event
async def on_raw_reaction_remove(payload):
messageID = payload.message_id
reaction = payload.emoji.name
role_name = msgManager.find_role(str(messageID), reaction)
msg_properties = msgManager.get_properties(str(messageID))

guild = bot.get_guild(payload.guild_id)
#Use guild.get_member since payload.member is None on ReactionRemove
member = guild.get_member(payload.user_id)
role = discord.utils.get(guild.roles, name=role_name)

#Extra check for management uses
if member == guild.owner and "ignoreOwner" in msg_properties:
print("Ignoring owner")
return

if role:
await member.remove_roles(role)

@bot.add_listener
async def on_command_error(ctx, error):
if type(error) == commands.CheckFailure:
pass
elif type(error) == commands.CommandNotFound:
pass
else:
await ctx.message.channel.send(error)

@bot.add_listener
async def on_message(message):
soldier_spellings = ['soldier', 'solider', 'soilder', 'solidier', 'soldeir']
if message.channel.id == 746515160377851997: #prep_screen id
bot_member = message.guild.get_member(bot.user.id)
bot_role = discord.utils.get(message.guild.roles, name="Conscripter")
if bot_role in bot_member.roles:
if any(word in message.content.lower() for word in soldier_spellings):
role = discord.utils.get(message.guild.roles, name="Soldier")
await message.author.add_roles(role)

@bot.command()
async def donate():
async def donate(ctx):
"""you know it"""
await bot.say("https://donorbox.org/donate-to-circles")
await ctx.send("https://donate.tiltify.com/+fire-emblem-universe/fire-emblem-e3-2021")
await ctx.send("https://www.patreon.com/theFEUfund")
# await ctx.send("https://donorbox.org/donate-to-circles")

token = os.environ.get('TOKEN', default=None)
if token is None:
token = open('./token').read().replace('\n','')

reactions.setup(bot)
memes.setup(bot)
helpful.setup(bot)
bot.reload = lambda: setupBot(bot)

bot.run(token)


4 changes: 2 additions & 2 deletions feubotFormatter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from discord.ext.commands import HelpFormatter
from discord.ext.commands import HelpCommand

class FeubotFormatter(HelpFormatter):
class FeubotFormatter(HelpCommand):
def filter_command_list(self):
return sorted(super().filter_command_list(), key=lambda e: str.lower(e[0]))

Binary file added goofs/EN.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added goofs/anecdote.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added goofs/artifact.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added goofs/beat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added goofs/bondage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added goofs/candy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added goofs/cute.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added goofs/dead.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added goofs/depression.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added goofs/gheb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added goofs/goof.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added goofs/handcuffs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added goofs/keriku.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added goofs/metagoof.png
Binary file added goofs/out.png
Binary file added goofs/porn.png
Binary file added goofs/prostitute.png
Binary file added goofs/reeg.png
Binary file added goofs/sex.png
Binary file added goofs/stalkers.png
Binary file added hard.png
95 changes: 69 additions & 26 deletions helpful.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,55 +62,85 @@ def create_embed(posts, threads, term):
text="Truncated %d result(s)." % (len(posts)-numresults))
return result

class Helpful:
class Helpful(bot.Cog):
"""Actually Helpful commands"""

def __init__(self, bot):
self.bot = bot
# ctx = bot
# self.port = bot.listen('on_message')(self.port)

@bot.command()
async def mod(self, ctx, rule_num, *, link):
"""!mod <rule number> <link to objectionable message>"""
FEU_id = 144670830150811649
if ctx.message.guild is None or ctx.message.guild.id == FEU_id:
await ctx.message.author.send("Your request for moderation was successful.")
if ctx.message.guild is not None:
await ctx.message.delete
mod_channel = self.bot.get_channel(650911156277477377)
paladins = discord.utils.get(ctx.message.guild.roles, id=145992793796378624).mention
await ctx.mod_channel.send("%s, moderation request received by user %s: Rule %s, at <%s>." % (paladins, ctx.message.author.name, rule_num, link))
else:
await ctx.send("Moderation features are for FEU only.")

@bot.command()
async def howtomod(self, ctx):
"""Gives information on how to use the !mod command."""
await ctx.send("First, have Developer Mode enabled (Settings -> Appearance -> Developer Mode).")
await ctx.send("Then, click the `...` by the offending message, and click \"Copy Link\".")
await ctx.send("Then simple say !mod <n> <link>, where <n> is the rule it violates, and <link> is the pasted link to the message.")
await ctx.send("If you do not have Developer Mode, you may instead of a link, write a short description of where the infraction took place, and by who.")
await ctx.send("Note that after requesting moderation, the message requesting moderation will be removed.")

@bot.command()
async def goldmine(self):
async def goldmine(self, ctx):
"""everything you ever wanted"""
embed=discord.Embed(title="Unified FE Hacking Dropbox", url='https://www.dropbox.com/sh/xl73trcck2la799/AAAMdpNSGQWEzYkLEQEiEhGFa?dl=0', description="All the hacking resources you could ever need, in one place", color=0xefba01)
# embed.set_thumbnail(url='http://i.imgur.com/Bg5NSga.png')
await self.bot.say(embed=embed)
await ctx.send(embed=embed)

# @bot.command() # removed aliases=["repo"]
# async def repository(self, ctx):
# """graphics for you"""
# embed=discord.Embed(title="Emblem Anims", url='https://emblem-anims.herokuapp.com/', description="Get your animations here (credits missing on some, check just in case!)", color=0x4286f4)
# await ctx.send(embed=embed)

@bot.command()
async def mugs(self):
async def mugs(self, ctx):
"""Link to image of all GBAFE mugs."""
await self.bot.say("http://doc.feuniverse.us/static/resources/mugs.png")
await ctx.send("http://doc.feuniverse.us/static/resources/mugs.png")

@bot.command()
async def hit(self, number, type="2RN"):
async def hit(self, ctx, number, type="2RN"):
"""Convert 2RN/fates hit to actual chance"""
try:
num = int(number)
except ValueError:
await self.bot.say("Specify an integer 0-100")
await ctx.send("Specify an integer 0-100")
return
if (num < 0) or (num > 100):
await self.bot.say("Specify an integer 0-100")
await ctx.send("Specify an integer 0-100")
return
if type.upper()=="2RN":
table = [0.00, 0.03, 0.10, 0.21, 0.36, 0.55, 0.78, 1.05, 1.36, 1.71, 2.10, 2.53, 3.00, 3.51, 4.06, 4.65, 5.28, 5.95, 6.66, 7.41, 8.20, 9.03, 9.90, 10.81, 11.76, 12.75, 13.78, 14.85, 15.96, 17.11, 18.30, 19.53, 20.80, 22.11, 23.46, 24.85, 26.28, 27.75, 29.26, 30.81, 32.40, 34.03, 35.70, 37.41, 39.16, 40.95, 42.78, 44.65, 46.56, 48.51, 50.50, 52.47, 54.40, 56.29, 58.14, 59.95, 61.72, 63.45, 65.14, 66.79, 68.40, 69.97, 71.50, 72.99, 74.44, 75.85, 77.22, 78.55, 79.84, 81.09, 82.30, 83.47, 84.60, 85.69, 86.74, 87.75, 88.72, 89.65, 90.54, 91.39, 92.20, 92.97, 93.70, 94.39, 95.04, 95.65, 96.22, 96.75, 97.24, 97.69, 98.10, 98.47, 98.80, 99.09, 99.34, 99.55, 99.72, 99.85, 99.94, 99.99, 100.00]
elif type.upper()=="FATES":
table = [0,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.5,51.83,53.17,54.5,55.83,57.17,58.5,59.83,61.17,62.5,63.83,65.17,66.5,67.83,69.17,70.5,71.83,73.17,74.5,75.83,77.17,78.5,79.83,81.17,82.5,83.83,85.12,86.35,87.53,88.66,89.73,90.75,91.72,92.63,93.49,94.3,95.05,95.75,96.4,96.99,97.53,98.02,98.45,98.83,99.16,99.43,99.65,99.82,99.93,99.99,100]
else:
await self.bot.say("Valid types are 2RN, Fates")
await ctx.send("Valid types are 2RN, Fates")
return
await self.bot.say(str(table[num]))
await ctx.send(str(table[num]))

@bot.command()
async def roll(self, number, type="2RN"):
async def roll(self, ctx, number, type="2RN"):
"""rolls hit or miss (e.g. >>hit 50 1rn/2rn[default]/fates)"""
try:
num = int(number)
except ValueError:
await self.bot.say("Specify an integer 0-100")
await ctx.send("Specify an integer 0-100")
return
if (num < 0) or (num > 100):
await self.bot.say("Specify an integer 0-100")
await ctx.send("Specify an integer 0-100")
return
if type.upper()=="1RN":
rolled = random.randint(1,100)
Expand All @@ -121,13 +151,21 @@ async def roll(self, number, type="2RN"):
if rolled > 50:
rolled = ((rolled*3) + random.randint(1,100))>>2
else:
await self.bot.say("Valid types are 1RN, 2RN, Fates")
await ctx.send("Valid types are 1RN, 2RN, Fates")
return
if rolled <= num: await self.bot.say("HIT (%d)" % rolled)
else: await self.bot.say("MISS (%d)" % rolled)
if rolled <= num: await ctx.send("HIT (%d)" % rolled)
else: await ctx.send("MISS (%d)" % rolled)

@bot.command()
async def search(self, *, term):
@bot.command() # removed aliases = ['die']
async def rollDie(self, ctx, n : int):
if n <= 0:
await ctx.send("Specify a positive integer.")
return
res = random.randrange(n) + 1
await ctx.send(str(res))

@bot.command(aliases=['s'])
async def search(self, ctx, *, term):
"""search feu"""
root = "http://feuniverse.us/search.json?q=%s"
payload = urllib.parse.quote(term)
Expand All @@ -143,22 +181,27 @@ async def search(self, *, term):
# data = json.loads(js.read().decode())
posts = data["posts"]
threads = data["topics"]
await self.bot.say(embed=create_embed(posts, threads, payload))
await ctx.send(embed=create_embed(posts, threads, payload))
except urllib.error.URLError:
await self.bot.say("Error accessing FEU server, please try again later.")
await ctx.send("Error accessing FEU server, please try again later.")
except KeyError:
embedded=create_embed(posts, [], payload)
try:
await self.bot.say(embed=embedded)
await ctx.send(embed=embedded)
except discord.errors.HTTPException:
print(embedded.title)

@bot.command(aliases=["UT2"])
async def ut2(self):
@bot.command() #aliases=["UT2"]
async def ut2(self, ctx):
"""links ultimate tutorial v2"""
embed=discord.Embed(title="Fire Emblem Hacking Ultimate Tutorial v2", url='https://tutorial.feuniverse.us/', description="How to do everything with Event Assembler buildfiles", color=0x40caf2)
await self.bot.say(embed=embed)
await ctx.send(embed=embed)

async def port(self, ctx, msg):
if str(msg.author.id) != 149576374984638464: return
if 'PORT' in msg.content.upper():
pass
# await ctx.send(msg.channel, '```I think you mean MUG```')

def setup(bot):
bot.add_cog(Helpful(bot))
async def setup(bot):
await bot.add_cog(Helpful(bot))
Binary file added lel.png
Binary file added lel2.png
Binary file added marisa.png
Loading