-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.py
54 lines (40 loc) · 1.4 KB
/
bot.py
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
51
52
53
54
from doctest import debug_script
import hikari
import lightbulb
import os
import random
import dotenv
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN') # Create a .env containing and setting your discord token. DISCORD_TOKEN = token
bot = lightbulb.BotApp(token=TOKEN, prefix='<=3', intents=hikari.Intents.ALL)
bot.load_extensions_from('./extensions/')
my_file = open("truth.txt", "r")
data = my_file.read() # reading the file
# replacing end splitting the text
# when newline ('\n') is seen.
truth_list = data.split('\n')
@bot.command
@lightbulb.command('ping', 'mumurahin ka')
@lightbulb.implements(lightbulb.SlashCommand)
async def ping(ctx):
await ctx.respond('tanginamo')
@bot.command
@lightbulb.command('truth', 'truth or dare kaso truth lang')
@lightbulb.implements(lightbulb.SlashCommand)
async def truth(ctx: lightbulb.SlashContext) -> None:
question = random.choice(truth_list)
embed = hikari.Embed(
title=question
)
embed.set_footer("/truth for more")
embed.set_author(name=ctx.author.username, icon=ctx.author.display_avatar_url)
await ctx.respond(embed)
@bot.command
@lightbulb.option('msg', "your message")
@lightbulb.command('embed', 'embed a message')
@lightbulb.implements(lightbulb.SlashCommand)
async def embed(ctx: lightbulb.SlashContext) -> None:
em = hikari.Embed(title=str(ctx.options.msg))
await ctx.respond(em)
bot.run()