Adding timeout command and aliases for youtube and sheeb
This commit is contained in:
parent
38b1273ede
commit
2bf6b7082b
41
app/bot.py
41
app/bot.py
@ -6,14 +6,18 @@ import requests
|
|||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
|
|
||||||
TOKEN = os.getenv("token")
|
|
||||||
intents = discord.Intents.default()
|
intents = discord.Intents.default()
|
||||||
|
intents.message_content = True
|
||||||
intents.members = True
|
intents.members = True
|
||||||
bot = commands.Bot(command_prefix="!", intents=intents)
|
bot = commands.Bot(command_prefix="!", intents=intents)
|
||||||
# Remove the default !help action so we can use our own
|
|
||||||
bot.remove_command("help")
|
bot.remove_command("help")
|
||||||
|
|
||||||
|
|
||||||
|
@bot.command()
|
||||||
|
async def ping(ctx):
|
||||||
|
await ctx.send("pong")
|
||||||
|
|
||||||
|
|
||||||
def generate_embed(
|
def generate_embed(
|
||||||
embed_url=None,
|
embed_url=None,
|
||||||
embed_title=None,
|
embed_title=None,
|
||||||
@ -114,7 +118,6 @@ async def on_ready():
|
|||||||
type=discord.ActivityType.listening, name="type !help"
|
type=discord.ActivityType.listening, name="type !help"
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
await bot.get_channel(152921472304676865).send("I have reconnected")
|
|
||||||
|
|
||||||
|
|
||||||
@bot.command(name="shoo")
|
@bot.command(name="shoo")
|
||||||
@ -360,7 +363,10 @@ async def dog(ctx):
|
|||||||
await ctx.send(animals.get_dog())
|
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):
|
async def dog(ctx):
|
||||||
|
|
||||||
import animals
|
import animals
|
||||||
@ -368,7 +374,7 @@ async def dog(ctx):
|
|||||||
await ctx.send(animals.random_sheeb())
|
await ctx.send(animals.random_sheeb())
|
||||||
|
|
||||||
|
|
||||||
@bot.command(name="define")
|
@bot.command(name="define", aliases=["ud"])
|
||||||
async def define(ctx):
|
async def define(ctx):
|
||||||
|
|
||||||
import define_word
|
import define_word
|
||||||
@ -599,6 +605,20 @@ async def tts(ctx):
|
|||||||
os.remove(file_path)
|
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")
|
@bot.command(name="issue")
|
||||||
async def issue(ctx):
|
async def issue(ctx):
|
||||||
import gitlab
|
import gitlab
|
||||||
@ -612,12 +632,7 @@ async def source(ctx):
|
|||||||
await ctx.send("https://git.luker.gq/ldooks/dragon-bot")
|
await ctx.send("https://git.luker.gq/ldooks/dragon-bot")
|
||||||
|
|
||||||
|
|
||||||
@bot.command(name="yt")
|
@bot.command(name="youtube", aliases=["yt"])
|
||||||
async def yt(ctx):
|
|
||||||
await youtube(ctx)
|
|
||||||
|
|
||||||
|
|
||||||
@bot.command(name="youtube")
|
|
||||||
async def youtube(ctx):
|
async def youtube(ctx):
|
||||||
import youtube
|
import youtube
|
||||||
|
|
||||||
@ -628,11 +643,9 @@ async def youtube(ctx):
|
|||||||
|
|
||||||
@bot.command(name="flows")
|
@bot.command(name="flows")
|
||||||
async def flows(ctx):
|
async def flows(ctx):
|
||||||
|
|
||||||
import river_stats
|
import river_stats
|
||||||
|
|
||||||
result = river_stats.get_stats()
|
result = river_stats.get_stats()
|
||||||
|
|
||||||
await ctx.send(embed=result)
|
await ctx.send(embed=result)
|
||||||
|
|
||||||
|
|
||||||
@ -767,4 +780,4 @@ async def on_command_completion(ctx):
|
|||||||
await channel.send(embed=embed)
|
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
|
beautifulsoup4
|
||||||
cmagick
|
cmagick
|
||||||
discord.py
|
|
||||||
gTTS
|
gTTS
|
||||||
|
humanfriendly
|
||||||
lxml
|
lxml
|
||||||
owotext
|
owotext
|
||||||
pandas
|
pandas
|
||||||
|
git+https://github.com/pycord-development/pycord
|
||||||
requests
|
requests
|
||||||
wikipedia
|
wikipedia
|
||||||
wolframalpha
|
wolframalpha
|
@ -8,7 +8,7 @@ image:
|
|||||||
repository: ldooks/dragon-bot
|
repository: ldooks/dragon-bot
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: IfNotPresent
|
||||||
# Overrides the image tag whose default is the chart appVersion.
|
# Overrides the image tag whose default is the chart appVersion.
|
||||||
tag: "151"
|
tag: "152"
|
||||||
|
|
||||||
imagePullSecrets: []
|
imagePullSecrets: []
|
||||||
nameOverride: ""
|
nameOverride: ""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user