Update social media link corrections for x.com and twitter.com, also update makefile to fix python formatter issues
This commit is contained in:
parent
ba28561f99
commit
1e59e5561d
3
Makefile
3
Makefile
@ -1,7 +1,8 @@
|
|||||||
include .env
|
include .env
|
||||||
|
|
||||||
|
# https://github.com/psf/black/issues/1106#issuecomment-547230844
|
||||||
format:
|
format:
|
||||||
docker run --rm -ti -v ${PWD}:/tmp/python/app python:alpine sh -c "cd /tmp/python; pip install -q black; black ."
|
docker run --rm -ti -v ${PWD}:/tmp/python/app python:alpine sh -c "apk add --no-cache gcc musl-dev; cd /tmp/python; pip install -q black; black ."
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
docker rm -f dragon-bot-test
|
docker rm -f dragon-bot-test
|
||||||
|
35
app/bot.py
35
app/bot.py
@ -114,18 +114,7 @@ async def convert_heic_to_jpg(ctx):
|
|||||||
|
|
||||||
|
|
||||||
@bot.listen("on_message")
|
@bot.listen("on_message")
|
||||||
async def annoy_jason(ctx):
|
async def fix_social_media_links(ctx):
|
||||||
if ctx.author.id == 83012791983673344 and "twitter.com" in ctx.content:
|
|
||||||
# my author id for testing
|
|
||||||
# if ctx.author.id == core_utils.my_id and "twitter.com" in ctx.content:
|
|
||||||
await ctx.reply(
|
|
||||||
"https://tenor.com/view/oomfie-klee-genshin-impact-smook-smokingissad-gif-21571907"
|
|
||||||
)
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
@bot.listen("on_message")
|
|
||||||
async def fix_tiktok_links(ctx):
|
|
||||||
if "https://www.tiktok.com" in ctx.content:
|
if "https://www.tiktok.com" in ctx.content:
|
||||||
await ctx.channel.send(
|
await ctx.channel.send(
|
||||||
"%s said:\n%s"
|
"%s said:\n%s"
|
||||||
@ -137,6 +126,28 @@ async def fix_tiktok_links(ctx):
|
|||||||
await ctx.delete()
|
await ctx.delete()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if "https://twitter.com" in ctx.content:
|
||||||
|
await ctx.channel.send(
|
||||||
|
"%s said:\n%s"
|
||||||
|
% (
|
||||||
|
ctx.author.mention,
|
||||||
|
ctx.content.replace("twitter", "vxtwitter"),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
await ctx.delete()
|
||||||
|
return
|
||||||
|
|
||||||
|
if "https://x.com" in ctx.content:
|
||||||
|
await ctx.channel.send(
|
||||||
|
"%s said:\n%s"
|
||||||
|
% (
|
||||||
|
ctx.author.mention,
|
||||||
|
ctx.content.replace("x", "vxtwitter"),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
await ctx.delete()
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
async def on_message(ctx):
|
async def on_message(ctx):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user