async def on_message(self, message: discord.Message): # Chat Money if not isinstance(message.channel, discord.DMChannel): pref: str = get_prefix(message.guild) guild_data: dict = checkin_guild(message.guild) get_money: int = random.randint(guild_data["currency"]["chat-min"], guild_data["currency"]["chat-max"]) await add_money(message.guild.id, message.author, get_money)
async def _page_one(message: discord.Message): pref: str = get_prefix(message.guild) emb = discord.Embed( title="Welcome Player!", description= "To get started with this RPG, Use the `start` command." "Use the command type prefix followed by the name of the command." "`<prefix><command>`", colour=WHITE) emb.add_field( name="What is this bot anyway?", value= "An RPG with Turn Base Battle which you can make your own `Moves`, your own `Equipment`, and your own `Items` to play around with." "There's also some minigames and other cool stuff you want to explore :)", inline=False) emb.add_field(name="RPG Commands :", value="`start` - Getting started with RPG\n" "`adventure`|`adv` - Virtual adventure\n" "`battle`|`btl` - Battle multiplayer\n" "`close` - Close your progress\n" "`equip` - Managing equipment\n" "`item` - Managing item\n" "`learn` - Learn any moves in server\n" "`moves` - See your current moves\n" "`manual` - Manual all about this RPG\n" "`class` - Check classes available\n" "`nature` - Check Nature available\n" "`skilladd` - Upgrade your primary stat\n" "`skillres` - Reset your skill point\n" "`stat` - Your detail in RPG", inline=False) await message.edit(embed=emb)
def check_guild_prefix(bot: commands.Bot, message: discord.Message): """Check Current Guild Prefix in Command or Message.""" if not isinstance(message.channel, discord.DMChannel): pref: str = get_prefix(message.guild) if message.content[0:len(pref)].lower() == pref.lower(): return message.content[0:len(pref)] else: return "This is Not a Prefix for this Server, Try Again later!..."
async def dice_help(channel: discord.TextChannel): pref: str = get_prefix(channel.guild) emb = discord.Embed(title="Γ°ΕΈΕ½Β² Invalid Input", description=f"> {pref}dice <amount> <dots>\n" "> Amount of Dice : 1 - 100\n" "> Dots on Dice : 1 - 100", colour=WHITE) emb.set_footer(text=f"Ex : {pref}dice 10 10") await channel.send(embed=emb)
async def on_message(self, message: discord.Message): """Built-in Event Message.""" # Get Prefix by tagging Bot if not isinstance(message.channel, discord.DMChannel): pref: str = get_prefix(message.guild) if str(self.bot.user.id) in message.content: emb = discord.Embed( description=f"Your Server Prefix is **{pref}**\n" f"type **{pref}**help for commands.", color=WHITE ) await message.channel.send(embed=emb)
async def print_skill_add_help(channel: discord.TextChannel): pref: str = get_prefix(channel.guild) emb = discord.Embed( title="Add Skill | Help", description="Use your Skillpoint to increase your primary stat.\n" "These are the skill you can increase it : `Strength` `Endurance` `Agility` `Focus` `Intelligence` `Wise`", colour=WHITE) emb.add_field(name="Command : ", value=f"`{pref}skilladd <skill> <amount>`", inline=False) emb.set_footer( text= f"Example Command to Upgrade Strength : {get_prefix(channel.guild.id)}skilladd strength 3" ) await channel.send(embed=emb)
async def __creator_help(self, channel: discord.TextChannel): pref: str = get_prefix(channel.guild) emb = discord.Embed(title="π‘οΈ Create Stuff | Help", colour=WHITE) emb.add_field(name="Command :", value=f"> `{pref}create <option> [anyname]`", inline=False) emb.add_field(name="Options :", value="`move`|`m` - Custom move\n" "`item`|`i` - Custom item\n" "`equipment`|`eq` - Custom equipment", inline=False) emb.set_footer( text= f"Example command to create a custom move: {pref}create move Fireball with Spaghetti" ) await channel.send(embed=emb)
async def print_help(channel: discord.TextChannel): pref: str = get_prefix(channel.guild) emb = discord.Embed( title="βοΈ Battlefield | Help", description= f"A Turnbase RPG game, you will pay it manually, don't forget to {pref}.start to start your progress.", colour=WHITE) emb.add_field(name="Command :", value=f"{pref}.battle <mode>", inline=False) emb.add_field(name="Mode :", value="`1v1` - 1 vs 1 Player\n" "`2v2` - 2 vs 2 Player\n" "`3v3` - 3 vs 3 Player", inline=False) emb.set_footer(text=f"Example Command : {pref}.battle 1v1") await channel.send(embed=emb)
async def blackjack_help(self, channel: discord.TextChannel): pref: str = get_prefix(channel.guild) emb = discord.Embed(title="π‘ Blackjack | Help", colour=WHITE) emb.add_field( name="Command :", value=f"> `{pref}.blackjack <option>`", inline=False ) emb.add_field( name="Options :", value="`[@]` - Challange tagged person\n" "`bot`|`play` - Challange bot\n" "`-h`|`help` - This help menu", inline=False ) emb.set_footer(text=f"Example Command : {pref}blackjack play") await channel.send(embed=emb)
async def _page_three(message: discord.Message): pref: str = get_prefix(message.guild) emb = discord.Embed( title="Skills and Substats", description= "These skills will improve much for your character substat which will be used for `battle`.", colour=WHITE) emb.add_field( name="Skill (alias) :", value= "`Strength` (`STR`) - Improves Attack. Big muscles kill your enemy.\n" "`Endurance` (`END`) - Improves Hitpoint. You can stay longer in the arena.\n" "`Agility` (`AGI`) - Improves Speed. Who's faster will get the first turn.\n" "`Focus` (`FOC`) - Improves Critical Chance of any Attack type.\n" "`Intelligence` (`ITE`) - Improves Magic Attack. Smarter to use spells at your enemy.\n" "`Wise` (`WIS`) - Improves Defend against Magic.", inline=False) await message.edit(embed=emb)
async def _class_help(channel: discord.TextChannel): pref: str = get_prefix(channel.guild) emb = discord.Embed(title="Γ°ΕΈοΏ½Β« Classes | List", description="Change your class, you can be :\n" "> 1. `Warrior`\n" "> 2. `Mage`\n", colour=WHITE) emb.add_field(name="Command :", value=f"> `{pref}class <option>`", inline=False) emb.add_field(name="Options :", value="`<number>` - Change your class\n" "`-i`|`info` - See class detail", inline=False) emb.set_footer( text=f"Example Command to change your class to Mage : {pref}class 2" ) await channel.send(embed=emb)
async def print_help(channel: discord.TextChannel): pref: str = get_prefix(channel.guild) emb = discord.Embed(title="βοΈ Auto Fair Duel Fight", colour=WHITE) emb.add_field(name="Command :", value=f"`{pref}duel <option>`", inline=False) emb.add_field(name="Options :", value="`[name]` - Challange this person\n" "`[@]` - Duel tagged person\n" "`[@] [@]` - Duel between 2 tags\n" "`-s`|`start` - Start fight you vs random person\n" "`-r`|`random` - Random 2 person", inline=False) emb.set_thumbnail( url= "https://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/Crossed_swords.svg/512px-Crossed_swords.svg.png" ) emb.set_footer(text=f"Example Command : {pref}duel @Gamern't Bot") await channel.send(embed=emb)
async def _nature_help(channel: discord.TextChannel): pref: str = get_prefix(channel.guild) emb = discord.Embed( title=" Character Natures | List", description= "Change your current nature, your character attitude gonna be :\n" "> 1. `Normal`\n" "> 2. `Aggresive`\n", colour=WHITE) emb.add_field(name="Command :", value=f"> `{pref}nature <option>`", inline=False) emb.add_field(name="Options :", value="`<number>` - Change your nature\n" "`-i`|`info` - See nature detail", inline=False) emb.set_footer( text= f"Example Command to change your nature to Aggresive : {pref}nature 2" ) await channel.send(embed=emb)
async def print_help(channel: discord.TextChannel): pref: str = get_prefix(channel.guild) emb = discord.Embed( title="π One Word Story | Help", colour=WHITE ) emb.add_field( name="Command :", value=f"> `{pref}ows <option>`", inline=False ) emb.add_field( name="Options :", value="> `-p` `play` - Start game in the channel\n" "> `-h` `help` - Help about one word story\n" "> `-r <num>` - Read your story\n" "> `-os <page>` - Books sriten by server\n" "> `-del <index>` - Delete server story\n" "> `-how` - How to play ows game", inline=False ) emb.set_footer(text= f"Example Command: {pref}ows -p") await channel.send(embed=emb)
async def print_help(channel: discord.TextChannel): pref: str = get_prefix(channel.guild) emb = discord.Embed( title="πΈ Currency Manager | Help", description="A custom server currency, set your chat money, set yout currency and " "use this money for several things like buy items, equipments, and learn moves.", colour=WHITE ) emb.add_field( name="Command :", value=f"`{pref}cur <option>`", inline=False ) emb.add_field( name="Options :", value="`-t <symbol>` - Set currency type in your server\n" "`-get` Get info about server currency\n" "`-min <amount>` - Set minimal getting money by chat\n" "`-max <amount>` - Set maximal getting money by chat", inline=False ) emb.set_footer(text=f"Example Command : {pref}cur -get") await channel.send(embed=emb)
async def _page_two(message: discord.Message): pref: str = get_prefix(message.guild) emb = discord.Embed( title="RPG User Stat", description= "After you have made your character, you can see your stat profile with `stat` command. " "This is Optional : You can close your progress with `close` command, but it will completely deleted your currents. ", colour=WHITE) emb.add_field( name="What's in your Stat?", value="`LVL` & `EXP` - Your Experience with RPG\n" "`SP` - Your Skill Point(s)\n" "`CLASS` - Which class and nature you are in.\n" "`Skill Stat` - Your skills to improve your character Substat\n" "`Substat` - This will be use in the battlefield to show how strong you are", inline=False) emb.add_field( name="How to improve my character?", value= "You can improve your stats if you have `SP` (Skill Points). Each time you leveled up, you will gain 1 SP to upgrade your Stat. " "To level up your character, you can `battle` with others and `chat` in server if the bot is in the server. " "Use `SP` with `skilladd` command.", inline=False) await message.edit(embed=emb)
async def ows_on_play(self, channel: discord.TextChannel): # Inner Function def check_user_sent_title(p: discord.User): def inner_check(message: discord.Message): if p == message.author and channel == message.channel: return True else: return False return inner_check # Initialize Game story: str = "" counter: int = 0 emb: discord.Embed = discord.Embed( title="π One Word Story | On Going", description="```All Words in Here```", colour=WHITE ) emb.set_footer(text = f"Latest Word Sent : [Time] [Player Name]") hm: discord.Message = await channel.send(embed=emb) # Gameplay try: while True: get_msg: discord.Message = await self.bot.wait_for( event="message", check=self.check_on_play(channel), timeout=86400.0 ) if get_msg.content == "UNDO": list_words: list = story.split(" ") story = " ".join(list_words[:len(list_words) - 1]) emb: discord.Embed = discord.Embed( title="π One Word Story | On Going", description=story, colour=WHITE ) emb.set_footer(text=f"Latest Word Sent : by {get_msg.author.name} at {datetime.datetime.now().strftime('%H:%M, %B %d %Y')}") await hm.edit(embed=emb) elif get_msg.content == "THEEND": await hm.delete() last_msg: discord.Message = await channel.send(content=f"{get_msg.author.mention}, Please Give the Best Title!", embed=emb) story_title = await self.bot.wait_for( event="message", check=check_user_sent_title(get_msg.author) ) book: dict = { "title": story_title.content, "story": story, "date-made": datetime.datetime.now().strftime('%B %d %Y') } emb: discord.Embed = discord.Embed( title=f"{book['title']}", description=story, colour=discord.Colour(WHITE) ) await last_msg.delete() emb.set_footer(text=f"Made on: {book['date-made']}") await channel.send(embed=emb) db_gld.UpdateObject({"guild_id": str(channel.guild.id)}, {"$push": {"stories": book}}) break elif get_msg.content == "CANCEL": emb: discord.Embed = discord.Embed( title="Game Forfeited, You have lost your Current Story.", description=f"__**Story on Board :**__ \n{story}", colour=WHITE ) await hm.edit(embed=emb) break elif get_msg.content.startswith(get_prefix(channel.guild)): continue else: story = self.space_check(story, get_msg.content) emb: discord.Embed = discord.Embed( title="π One Word Story | Set Title", description=story, colour=WHITE ) emb.set_footer(text=f"Latest Word Sent : by {get_msg.author.name} at {datetime.datetime.now().strftime('%H:%M, %B %d %Y')}") if counter > 10: counter -= 11 await hm.delete() hm = await channel.send(embed=emb) else: await hm.edit(embed=emb) counter += 1 except asyncio.TimeoutError: emb = discord.Embed( title="24 hours have passed since last Sent Message.\nGame forfeited and story has been deleted :(", colour=WHITE ) await hm.edit(embed=emb)
async def _help(self, ctx: commands.Context, *args): """Custom Help Command.""" pref: str = get_prefix(ctx.guild) emb = discord.Embed( title="π Help | Menu", description= "Type prefix followed by one of these command. (To make this public in server instead, add space followed by `public` next to command)\n" "> Note : don't use `public` in the server, this probably may cause spam and got blame for spam except if your server have a channel that able for spam.", colour=WHITE) emb.add_field(name="General Commands :", inline=False, value="`ping` - PING. PONG!\n" "`about`|`a` - Bot information\n" "`news` - What's new?\n" "`help`|`h` - This help command\n" "`prefix`|`pfix` - Change prefix\n" "`feedback`|`fb` - Send message to creator\n" "`settitle`|`st` - Change profile title\n" "`prof`|`user` - User profile\n" "`img`|`pict` - Search picture\n" "`setevent <channel>` - Set all event into channel") emb.add_field(name="Fun and Game Commands :", inline=False, value="`ask` - Ask me anything\n" "`chance` - Your chance of\n" "`choose` - Random chooser machine\n" "`duel` - Duel simulation\n" "`dice` - Roll the dice\n" "`dig`|`mine` - Mining is fun\n" "`hangman`|`hang` - Hangman game\n" "`ows` - One Word Story game\n" "`pool` - 8Pool says\n" "`rps` - Rock Paper Scissor\n" "`scramble`|`scr` - Guess scramble word\n" "`slot` - Slot machine\n" "`wordpref`|`wop` - Custom Word Prefix Game") emb.add_field(name="RPG Commands :", inline=False, value="`start` - Getting started with RPG\n" "`adventure`|`adv` - Virtual adventure\n" "`battle`|`btl` - Battle multiplayer\n" "`close` - Close your progress\n" "`equip` - Managing equipment\n" "`item` - Managing item\n" "`learn` - Learn any moves in server\n" "`mymoves` - See your current moves\n" "`manual` - Manual all about this RPG\n" "`class` - Check classes available\n" "`nature` - Check Nature available\n" "`skilladd` - Upgrade your primary stat\n" "`skillres` - Reset your skill point\n" "`stat` - Your detail in RPG\n" "`create` - Create a custom thing") emb.add_field(name="Meta and Misc Commands :", inline=False, value="`balance`|`bal` - Check yo money\n" "`buy` - Buy something in the shop\n" "`cur` - Manage server currency\n" "`inv` - Your inventory\n" "`leaderboard`|`lb` - Leaderboard in currency and RPG\n" "`ores`|`ore` - See your ore collection\n" "`shop` - Server shop and menu") emb.set_thumbnail(url=self.bot.user.avatar_url) emb.set_footer(text=f"Example Command : {pref}ping") if len(args) >= 1: if args[0].lower() == 'public': await ctx.send(embed=emb) else: await ctx.message.add_reaction("π") await ctx.author.send(embed=emb)