Adding timeout command and aliases for youtube and sheeb
This commit is contained in:
parent
e6cb266200
commit
0e53172149
41
app/bot.py
41
app/bot.py
@ -6,14 +6,18 @@ import requests
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
|
||||
TOKEN = os.getenv("token")
|
||||
intents = discord.Intents.default()
|
||||
intents.message_content = True
|
||||
intents.members = True
|
||||
bot = commands.Bot(command_prefix="!", intents=intents)
|
||||
# Remove the default !help action so we can use our own
|
||||
bot.remove_command("help")
|
||||
|
||||
|
||||
@bot.command()
|
||||
async def ping(ctx):
|
||||
await ctx.send("pong")
|
||||
|
||||
|
||||
def generate_embed(
|
||||
embed_url=None,
|
||||
embed_title=None,
|
||||
@ -114,7 +118,6 @@ async def on_ready():
|
||||
type=discord.ActivityType.listening, name="type !help"
|
||||
),
|
||||
)
|
||||
await bot.get_channel(152921472304676865).send("I have reconnected")
|
||||
|
||||
|
||||
@bot.command(name="shoo")
|
||||
@ -360,7 +363,10 @@ async def dog(ctx):
|
||||
await ctx.send(animals.get_dog())
|
||||
|
||||
|
||||
@bot.command(name="sheeb")
|
||||
@bot.command(
|
||||
name="sheeb",
|
||||
aliases=["shiba", "shib", "shoob", "sheeber", "shoober", "shobe", "shibe"],
|
||||
)
|
||||
async def dog(ctx):
|
||||
|
||||
import animals
|
||||
@ -368,7 +374,7 @@ async def dog(ctx):
|
||||
await ctx.send(animals.random_sheeb())
|
||||
|
||||
|
||||
@bot.command(name="define")
|
||||
@bot.command(name="define", aliases=["ud"])
|
||||
async def define(ctx):
|
||||
|
||||
import define_word
|
||||
@ -599,6 +605,20 @@ async def tts(ctx):
|
||||
os.remove(file_path)
|
||||
|
||||
|
||||
@bot.command()
|
||||
async def timeout(ctx, user: discord.Member = None, time=None, *, reason=None):
|
||||
if not ctx.message.author.discriminator == "2528":
|
||||
return
|
||||
|
||||
import humanfriendly
|
||||
import datetime
|
||||
|
||||
time = humanfriendly.parse_timespan(time)
|
||||
await user.timeout(until=discord.utils.utcnow() + datetime.timedelta(seconds=time))
|
||||
await user.send(reason)
|
||||
await ctx.send("Timed %s out for %s seconds" % (user.mention, time))
|
||||
|
||||
|
||||
@bot.command(name="issue")
|
||||
async def issue(ctx):
|
||||
import gitlab
|
||||
@ -612,12 +632,7 @@ async def source(ctx):
|
||||
await ctx.send("https://git.luker.gq/ldooks/dragon-bot")
|
||||
|
||||
|
||||
@bot.command(name="yt")
|
||||
async def yt(ctx):
|
||||
await youtube(ctx)
|
||||
|
||||
|
||||
@bot.command(name="youtube")
|
||||
@bot.command(name="youtube", aliases=["yt"])
|
||||
async def youtube(ctx):
|
||||
import youtube
|
||||
|
||||
@ -628,11 +643,9 @@ async def youtube(ctx):
|
||||
|
||||
@bot.command(name="flows")
|
||||
async def flows(ctx):
|
||||
|
||||
import river_stats
|
||||
|
||||
result = river_stats.get_stats()
|
||||
|
||||
await ctx.send(embed=result)
|
||||
|
||||
|
||||
@ -767,4 +780,4 @@ async def on_command_completion(ctx):
|
||||
await channel.send(embed=embed)
|
||||
|
||||
|
||||
bot.run(TOKEN)
|
||||
bot.run(os.getenv("token"))
|
||||
|
0
app/help_methods.py
Normal file → Executable file
0
app/help_methods.py
Normal file → Executable file
@ -1,10 +1,11 @@
|
||||
beautifulsoup4
|
||||
cmagick
|
||||
discord.py
|
||||
gTTS
|
||||
humanfriendly
|
||||
lxml
|
||||
owotext
|
||||
pandas
|
||||
git+https://github.com/pycord-development/pycord
|
||||
requests
|
||||
wikipedia
|
||||
wolframalpha
|
@ -8,7 +8,7 @@ image:
|
||||
repository: ldooks/dragon-bot
|
||||
pullPolicy: IfNotPresent
|
||||
# Overrides the image tag whose default is the chart appVersion.
|
||||
tag: "151"
|
||||
tag: "152"
|
||||
|
||||
imagePullSecrets: []
|
||||
nameOverride: ""
|
||||
|
Loading…
x
Reference in New Issue
Block a user