Skip to content

Instantly share code, notes, and snippets.

@edo0xff
Created April 14, 2020 00:09
Show Gist options
  • Save edo0xff/71f813520687d77945daaa010be04bab to your computer and use it in GitHub Desktop.
Save edo0xff/71f813520687d77945daaa010be04bab to your computer and use it in GitHub Desktop.
import time
import discord
import ErinaBot as erina
from datetime import datetime
ACCESS_TOKEN = "your_atoken_here"
client = discord.Client()
erina.conversation.load_dictionary("intentions.yml")
erina.conversation.load_dictionary("dialogs.yml")
@erina.intention
async def show_time(ctx, args):
"""
**Show system time**
You can ask me for show system time :smiley:
"""
date = datetime.utcfromtimestamp(time.time())
date = date.strftime('%Y-%m-%d %H:%M')
await ctx.channel.send("Server time: %s" %(date))
@erina.intention
async def send_meme(ctx, args):
"""
**Sending nice meme**
You can ask me for some memes B)
"""
img_url = "https://imgur.com/a/5ybu9TO"
embed = (discord.Embed(title="Dank meme", description="I found this meme for you <3")
.set_image(img_url))
await ctx.channel.send(embed=embed)
@client.event
async def on_ready():
print("Erina-san is ready!")
activity = discord.Activity(type=discord.ActivityType.watching, name="Movies!")
await client.change_presence(status=discord.Status.online, activity=activity)
@client.event
async def on_message(message):
if message.author == client.user:
return
if (not client.user in message.mentions)\
and (not message.mention_everyone)\
and (not erina.conversation.talking_to_me(message.content)):
return
# recognize the incoming message
await erina.conversation.recognize(message)
client.run(ACCESS_TOKEN)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment