Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
chatBotProject/Fun.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
29 lines (24 sloc)
1.42 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import discord | |
from discord.ext import commands | |
class Fun: | |
def __init__(self, client): | |
self.client = client | |
@commands.command(description="Concatenates the string after called with a gnome", | |
brief="Gnome's ya boi", | |
pass_context=True) | |
async def gnome(self,ctx, receiver): | |
"""Uses the receiver argument to concatinate a string to gnome anothuer user also mentions the author""" | |
message = "{0} you've just been gnomed by {1} https://gyazo.com/6f0fe2316d674b1ff9b0a9b8d471b71d.png".format(receiver, | |
ctx.message.author.mention) | |
await self.client.say(message) | |
async def on_message(self,message): | |
if message.author == self.client.user: | |
return | |
# if the user id posts a message in chat then it executes code | |
if message.author.id == "146032122774159360" and message.server.id == "505113732456775690": | |
await self.client.add_reaction(message, "👺") | |
# if a message contains "boost" in any place and the server id is the one specified it will send a message | |
if "boost" in message.content and message.server.id == "497091157591982081": | |
await self.client.send_message(message.channel, "https://gyazo.com/2a785b68d62386ad3566f671c81e532c.png") | |
def setup(client): | |
client.add_cog(Fun(client)) |