Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
411 commits
Select commit Hold shift + click to select a range
c5d8d88
Update ModContact.py
DiabeticTurtle Dec 8, 2022
adcd37b
Update tags.py
DiabeticTurtle Aug 1, 2023
bbbb0bb
Update tags.py
DiabeticTurtle Aug 1, 2023
05105d4
Update tags.py
DiabeticTurtle Aug 1, 2023
463ad61
Update tags.py
DiabeticTurtle Aug 1, 2023
7eefe11
Update tags.py
DiabeticTurtle Aug 1, 2023
6ef4ba4
Update tags.py
DiabeticTurtle Aug 1, 2023
a63dc31
Update tags.py
DiabeticTurtle Aug 1, 2023
98b47ae
Update tags.py
DiabeticTurtle Aug 1, 2023
df455e8
Update tags.py
DiabeticTurtle Aug 1, 2023
71482a7
Update tags.py
DiabeticTurtle Aug 1, 2023
7491518
Update tags.py
DiabeticTurtle Aug 1, 2023
8aeec19
Update tags.py
DiabeticTurtle Aug 1, 2023
37a338b
add pages to lists
DiabeticTurtle Aug 1, 2023
9967ed2
Update tags.py
DiabeticTurtle Aug 1, 2023
0f00fe0
update
DiabeticTurtle Aug 1, 2023
ee9db38
Update tags.py
DiabeticTurtle Aug 1, 2023
9c9cb45
Update tags.py
DiabeticTurtle Aug 1, 2023
eb3131e
Update tags.py
DiabeticTurtle Aug 1, 2023
860e1c9
update
DiabeticTurtle Aug 1, 2023
2efe7df
Update requirements.txt
DiabeticTurtle Aug 1, 2023
8ec4459
Update requirements.txt
DiabeticTurtle Aug 1, 2023
9946cfa
update
DiabeticTurtle Aug 1, 2023
45b6096
Update tags.py
DiabeticTurtle Aug 1, 2023
f6ed0fc
Update tags.py
DiabeticTurtle Aug 2, 2023
941741a
Update tags.py
DiabeticTurtle Aug 2, 2023
b3a399d
Update tags.py
DiabeticTurtle Aug 2, 2023
0858a1d
add edit category
DiabeticTurtle Aug 2, 2023
10a9092
Update tags.py
DiabeticTurtle Aug 2, 2023
83c14c0
Update models.py
DiabeticTurtle Aug 2, 2023
5adc4f4
Update tags.py
DiabeticTurtle Aug 2, 2023
5598105
Update tags.py
DiabeticTurtle Aug 2, 2023
1b70fa4
alphabetical ordered??
DiabeticTurtle Aug 2, 2023
5601043
add js support
DiabeticTurtle Aug 2, 2023
bd88696
add code command
DiabeticTurtle Aug 2, 2023
e78e8aa
Update tags.py
DiabeticTurtle Aug 2, 2023
74030f2
Update tags.py
DiabeticTurtle Aug 2, 2023
ebdecb8
Update tags.py
DiabeticTurtle Aug 2, 2023
ed246fc
Update tags.py
DiabeticTurtle Aug 2, 2023
af9e4e2
Update tags.py
DiabeticTurtle Aug 2, 2023
0dbc743
Update tags.py
DiabeticTurtle Aug 2, 2023
8eecded
Update tags.py
DiabeticTurtle Aug 2, 2023
e188adc
Update tags.py
DiabeticTurtle Aug 2, 2023
27e171c
Update tags.py
DiabeticTurtle Aug 2, 2023
d662f46
Update tags.py
DiabeticTurtle Aug 2, 2023
d64ccd2
Update tags.py
DiabeticTurtle Aug 2, 2023
6b01dfb
Update tags.py
DiabeticTurtle Aug 2, 2023
e1c4f55
Update tags.py
DiabeticTurtle Aug 2, 2023
644429a
Update tags.py
DiabeticTurtle Aug 2, 2023
9e70984
Update tags.py
DiabeticTurtle Aug 2, 2023
80b5c79
Update tags.py
DiabeticTurtle Aug 2, 2023
d36b63f
Update tags.py
DiabeticTurtle Aug 2, 2023
204010d
Update tags.py
DiabeticTurtle Aug 2, 2023
92f00b8
Update tags.py
DiabeticTurtle Aug 2, 2023
e89f407
Update tags.py
DiabeticTurtle Aug 2, 2023
7002915
Update tags.py
DiabeticTurtle Aug 2, 2023
6922b3a
Update tags.py
DiabeticTurtle Aug 2, 2023
bc21b45
Update tags.py
DiabeticTurtle Aug 2, 2023
818b8bf
Update tags.py
DiabeticTurtle Aug 2, 2023
b6968c9
Update tags.py
DiabeticTurtle Aug 2, 2023
19da5a1
Update tags.py
DiabeticTurtle Aug 2, 2023
d87864e
Update tags.py
DiabeticTurtle Aug 2, 2023
90b3e3c
Update tags.py
DiabeticTurtle Aug 2, 2023
05449a0
Update tags.py
DiabeticTurtle Aug 2, 2023
870820a
Update tags.py
DiabeticTurtle Aug 2, 2023
0626bb8
Update tags.py
DiabeticTurtle Aug 2, 2023
fdec96f
Update tags.py
DiabeticTurtle Aug 2, 2023
7675db9
Update tags.py
DiabeticTurtle Aug 2, 2023
a2c5cf8
Update tags.py
DiabeticTurtle Aug 2, 2023
2a8e6b4
Update tags.py
DiabeticTurtle Aug 2, 2023
e0c6d50
Update tags.py
DiabeticTurtle Aug 2, 2023
3c6b384
Update tags.py
DiabeticTurtle Aug 2, 2023
58d4d86
Update tags.py
DiabeticTurtle Aug 2, 2023
f08488c
Update tags.py
DiabeticTurtle Aug 2, 2023
a61f81c
Update tags.py
DiabeticTurtle Aug 2, 2023
c82fc46
Update tags.py
DiabeticTurtle Aug 2, 2023
be7223b
Update tags.py
DiabeticTurtle Aug 2, 2023
81780bf
Update tags.py
DiabeticTurtle Aug 2, 2023
29b9797
Update tags.py
DiabeticTurtle Aug 2, 2023
cd8c8b8
Update tags.py
DiabeticTurtle Aug 2, 2023
fe93d06
Update tags.py
DiabeticTurtle Aug 2, 2023
d1dc050
Update tags.py
DiabeticTurtle Aug 2, 2023
f51455f
Update tags.py
DiabeticTurtle Aug 17, 2023
e2b4c53
Update tags.py
DiabeticTurtle Aug 17, 2023
963fbd7
Update tags.py
DiabeticTurtle Aug 17, 2023
f2d86a5
Update rolemanager.py
DiabeticTurtle Sep 6, 2023
1652a20
update role manager
DiabeticTurtle Sep 6, 2023
c86a9ff
ignore roles
DiabeticTurtle Sep 6, 2023
d554abd
Update tags/tags.py
DiabeticTurtle Sep 6, 2023
299f8be
Update tags/tags.py
DiabeticTurtle Sep 6, 2023
32a5f5e
Update rolemanager.py
DiabeticTurtle Sep 6, 2023
547aac1
Update rolemanager.py
DiabeticTurtle Sep 6, 2023
7b67bb0
Merge branch 'main' of https://github.com/DiabeticTurtle/DiamodPlugins
DiabeticTurtle Sep 6, 2023
6c8c2db
Update models.py
DiabeticTurtle Sep 6, 2023
acacdc1
Update models.py
DiabeticTurtle Sep 6, 2023
07fe0b0
Update views.py
DiabeticTurtle Sep 6, 2023
5dd0a67
add allowed roles
DiabeticTurtle Sep 6, 2023
4f4c6e4
Update rolemanager.py
DiabeticTurtle Sep 6, 2023
381a32a
Update views.py
DiabeticTurtle Sep 6, 2023
b5d5afb
Update views.py
DiabeticTurtle Sep 6, 2023
1047114
Update views.py
DiabeticTurtle Sep 6, 2023
cb13448
Update rolemanager.py
DiabeticTurtle Sep 6, 2023
3ad7963
add allowed roles feature
DiabeticTurtle Sep 6, 2023
0dfe3dd
add more code
DiabeticTurtle Sep 6, 2023
67df2c1
Update rolemanager.py
DiabeticTurtle Sep 6, 2023
3ebbb2c
Update rolemanager.py
DiabeticTurtle Sep 6, 2023
940e0b5
remove code
DiabeticTurtle Sep 6, 2023
a870acb
Update views.py
DiabeticTurtle Sep 6, 2023
5c0b2bc
Update rolemanager.py
DiabeticTurtle Sep 7, 2023
be2d836
add code
DiabeticTurtle Sep 7, 2023
95d1d4a
Create rr.py
DiabeticTurtle Sep 7, 2023
7313155
Update rr.py
DiabeticTurtle Sep 7, 2023
58114c1
Update rr.py
DiabeticTurtle Sep 7, 2023
1c9bf89
Update rr.py
DiabeticTurtle Sep 7, 2023
1cfb5cb
Update rr.py
DiabeticTurtle Sep 7, 2023
1deb75b
Update rr.py
DiabeticTurtle Sep 7, 2023
ac572d3
Update rr.py
DiabeticTurtle Sep 7, 2023
e22085a
Update rr.py
DiabeticTurtle Sep 7, 2023
f27c735
Update rr.py
DiabeticTurtle Sep 7, 2023
5de2345
Update rr.py
DiabeticTurtle Sep 7, 2023
5099b8a
Update rr.py
DiabeticTurtle Sep 7, 2023
ac37d23
Revert "Update rr.py"
DiabeticTurtle Sep 7, 2023
eb63f4a
Revert "Update rr.py"
DiabeticTurtle Sep 7, 2023
5196a55
Revert "Update rr.py"
DiabeticTurtle Sep 7, 2023
311d662
Revert "Update rr.py"
DiabeticTurtle Sep 7, 2023
d013144
Update rr.py
DiabeticTurtle Sep 7, 2023
fb84c02
Update rr.py
DiabeticTurtle Sep 7, 2023
15e6ffd
Update rr.py
DiabeticTurtle Sep 7, 2023
f8f3551
Revert "Update rr.py"
DiabeticTurtle Sep 7, 2023
d4d1092
Update rr.py
DiabeticTurtle Sep 7, 2023
2adafab
Update rr.py
DiabeticTurtle Sep 7, 2023
51d1bb8
Revert "Update rr.py"
DiabeticTurtle Sep 7, 2023
6f4dc5e
update
DiabeticTurtle Sep 7, 2023
30b2a0d
Update rr.py
DiabeticTurtle Sep 7, 2023
4db8ff7
Update rr.py
DiabeticTurtle Sep 7, 2023
681fb8c
Update rr.py
DiabeticTurtle Sep 7, 2023
3c1bc66
rename
DiabeticTurtle Sep 7, 2023
a75ccd1
Update reactionrole.py
DiabeticTurtle Sep 7, 2023
29deaf1
Update reactionrole.py
DiabeticTurtle Sep 7, 2023
d62f1ad
Update reactionrole.py
DiabeticTurtle Sep 7, 2023
0388935
Update reactionrole.py
DiabeticTurtle Sep 7, 2023
68ab5ab
Update reactionrole.py
DiabeticTurtle Sep 7, 2023
c369bf4
Update reactionrole.py
DiabeticTurtle Sep 7, 2023
6d8a9be
Update reactionrole.py
DiabeticTurtle Sep 7, 2023
df79c30
Revert "Update reactionrole.py"
DiabeticTurtle Sep 7, 2023
e565f31
Update reactionrole.py
DiabeticTurtle Sep 7, 2023
eb2af17
Update reactionrole.py
DiabeticTurtle Sep 7, 2023
7f012e0
Revert "Update reactionrole.py"
DiabeticTurtle Sep 7, 2023
f37cd5a
Revert "Update reactionrole.py"
DiabeticTurtle Sep 7, 2023
49b404a
Update reactionrole.py
DiabeticTurtle Sep 7, 2023
4272403
Update tags.py
DiabeticTurtle Sep 8, 2023
36824d1
Update tags.py
DiabeticTurtle Sep 8, 2023
b1780f3
Update tags.py
DiabeticTurtle Sep 8, 2023
7300bc5
Revert "Update tags.py"
DiabeticTurtle Sep 8, 2023
f8da208
Revert "Update tags.py"
DiabeticTurtle Sep 8, 2023
bb6b500
Update tags.py
DiabeticTurtle Sep 8, 2023
3249bef
Update Welcomer.py
DiabeticTurtle Sep 8, 2023
65e37a9
Revert "Update Welcomer.py"
DiabeticTurtle Sep 8, 2023
7a94118
Update Welcomer.py
DiabeticTurtle Sep 8, 2023
f61cd4d
Update Welcomer.py
DiabeticTurtle Sep 8, 2023
87364eb
Update Welcomer.py
DiabeticTurtle Sep 8, 2023
083bc20
Update Welcomer.py
DiabeticTurtle Sep 8, 2023
5e13fd0
Update Welcomer.py
DiabeticTurtle Sep 8, 2023
dedd8f7
buttons
DiabeticTurtle Sep 8, 2023
7bc9fee
Update requirements.txt
DiabeticTurtle Sep 8, 2023
438dc9c
Revert "Revert "Update Welcomer.py""
DiabeticTurtle Sep 8, 2023
4f80c64
Update Welcomer.py
DiabeticTurtle Sep 8, 2023
3416c74
add beetify plugin
DiabeticTurtle Nov 1, 2023
2a9dff6
move beetify in folder
DiabeticTurtle Nov 1, 2023
efa6da9
Update beetify.py
DiabeticTurtle Nov 1, 2023
0b51dc6
Update beetify.py
DiabeticTurtle Nov 1, 2023
c36b7ac
Update beetify.py
DiabeticTurtle Nov 1, 2023
43b54fc
Update beetify.py
DiabeticTurtle Nov 1, 2023
61efe1e
Update beetify.py
DiabeticTurtle Nov 1, 2023
9d04e56
Update beetify.py
DiabeticTurtle Nov 1, 2023
4f25d7f
Update beetify.py
DiabeticTurtle Nov 1, 2023
433b7e8
change color
DiabeticTurtle Nov 1, 2023
efca15c
Update beetify.py
DiabeticTurtle Nov 1, 2023
9c21a3a
Update beetify.py
DiabeticTurtle Nov 1, 2023
59180c1
change color again
DiabeticTurtle Nov 1, 2023
c49517d
thicc circle now
DiabeticTurtle Nov 1, 2023
3972c75
could be doing this better but idk how so im not gonna
DiabeticTurtle Nov 1, 2023
da9ce09
Update beetify.py
DiabeticTurtle Nov 1, 2023
4da0bc7
Update beetify.py
DiabeticTurtle Nov 1, 2023
a06fe16
Update beetify.py
DiabeticTurtle Nov 1, 2023
d7d135e
Update beetify.py
DiabeticTurtle Nov 1, 2023
91202af
Update beetify.py
DiabeticTurtle Nov 1, 2023
71fb797
Update beetify.py
DiabeticTurtle Nov 1, 2023
ee1cb05
Update beetify.py
DiabeticTurtle Nov 1, 2023
990641d
Update beetify.py
DiabeticTurtle Nov 1, 2023
d27d590
Update beetify.py
DiabeticTurtle Nov 1, 2023
aa02d28
Update beetify.py
DiabeticTurtle Nov 1, 2023
58a2472
Update beetify.py
DiabeticTurtle Nov 1, 2023
0c9419e
Update beetify.py
DiabeticTurtle Nov 1, 2023
ce07c96
Update beetify.py
DiabeticTurtle Nov 1, 2023
c7fbb5a
Update beetify.py
DiabeticTurtle Nov 1, 2023
2112e24
Update beetify.py
DiabeticTurtle Nov 1, 2023
c747ba5
Update beetify.py
DiabeticTurtle Nov 1, 2023
ea53b8e
Update beetify.py
DiabeticTurtle Nov 1, 2023
d8ad4a8
Update beetify.py
DiabeticTurtle Nov 1, 2023
a92cd8a
Update beetify.py
DiabeticTurtle Nov 1, 2023
e2c560a
Update beetify.py
DiabeticTurtle Nov 1, 2023
214862c
Update beetify.py
DiabeticTurtle Nov 1, 2023
f1fdef5
Update beetify.py
DiabeticTurtle Nov 1, 2023
7a9b298
Update beetify.py
DiabeticTurtle Nov 1, 2023
a087aa1
Update beetify.py
DiabeticTurtle Nov 1, 2023
f3dbdea
Update beetify.py
DiabeticTurtle Nov 1, 2023
23f4338
Update beetify.py
DiabeticTurtle Nov 1, 2023
e896c9c
Update beetify.py
DiabeticTurtle Nov 1, 2023
4ea7c35
Update beetify.py
DiabeticTurtle Nov 1, 2023
aca1cf1
Update beetify.py
DiabeticTurtle Nov 1, 2023
0a8e8a8
Update beetify.py
DiabeticTurtle Nov 1, 2023
ecec857
Update beetify.py
DiabeticTurtle Nov 1, 2023
ce207f6
Update beetify.py
DiabeticTurtle Nov 1, 2023
e34c334
Update beetify.py
DiabeticTurtle Nov 1, 2023
c024169
Update beetify.py
DiabeticTurtle Nov 1, 2023
b18bf20
Update beetify.py
DiabeticTurtle Nov 1, 2023
15252f6
Update beetify.py
DiabeticTurtle Nov 1, 2023
29871cd
Update beetify.py
DiabeticTurtle Nov 1, 2023
6468873
Update beetify.py
DiabeticTurtle Nov 2, 2023
c30918a
Update beetify.py
DiabeticTurtle Nov 2, 2023
984dd84
Update beetify.py
DiabeticTurtle Nov 2, 2023
5491704
Update beetify.py
DiabeticTurtle Nov 2, 2023
c28552d
Update beetify.py
DiabeticTurtle Nov 2, 2023
54342d3
Update beetify.py
DiabeticTurtle Nov 2, 2023
6090549
Update beetify.py
DiabeticTurtle Nov 2, 2023
61ae940
Update beetify.py
DiabeticTurtle Nov 2, 2023
34e067c
Update beetify.py
DiabeticTurtle Nov 2, 2023
a63d93d
Update beetify.py
DiabeticTurtle Nov 2, 2023
322a7ea
Update beetify.py
DiabeticTurtle Nov 2, 2023
305f066
Update beetify.py
DiabeticTurtle Nov 2, 2023
99639fa
Update beetify.py
DiabeticTurtle Nov 2, 2023
83f50a5
Update beetify.py
DiabeticTurtle Nov 2, 2023
8aadeb4
Update beetify.py
DiabeticTurtle Nov 2, 2023
0280a23
Update README.md
DiabeticTurtle Nov 2, 2023
3c1d3f7
Update README.md
DiabeticTurtle Nov 2, 2023
62c87d2
Update beetify.py
DiabeticTurtle Nov 5, 2023
3526dff
Merge branch 'main' of https://github.com/DiabeticTurtle/DiamodPlugins
DiabeticTurtle Nov 5, 2023
1c41078
Update beetify.py
DiabeticTurtle Nov 5, 2023
34ebbbd
revert
DiabeticTurtle Nov 5, 2023
a194cc3
Update requirements.txt
DiabeticTurtle Nov 27, 2023
ec0ea6b
test
DiabeticTurtle Nov 27, 2023
9c62cbb
Create pumpchart.md
DiabeticTurtle Nov 27, 2023
4698a0c
Update pumpchart.md
DiabeticTurtle Nov 27, 2023
ca3deac
Update requirements.txt
DiabeticTurtle Dec 4, 2023
2692e05
Update requirements.txt
DiabeticTurtle Dec 4, 2023
381f7d8
Update tags.py
DiabeticTurtle Dec 13, 2023
8f7621e
covidwaste
DiabeticTurtle Oct 2, 2024
7545958
feat(tags): slash command
p5nbTgip0r Jun 27, 2025
bbb7136
Merge pull request #5 from p5nbTgip0r/tags-slashcmd
DiabeticTurtle Jun 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"githubPullRequests.ignoredPullRequestBranches": [
"main"
],
"python.analysis.typeCheckingMode": "basic"
}
67 changes: 67 additions & 0 deletions COVIDwastewatermap/COVIDWastewatermap.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{\rtf1\ansi\ansicpg1252\cocoartf2639
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\margl1440\margr1440\vieww11520\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0

\f0\fs24 \cf0 import discord\
from discord.ext import commands\
import requests\
import geopandas as gpd\
import matplotlib.pyplot as plt\
import io\
\
class COVIDWastewaterMap(commands.Cog):\
def __init__(self, bot):\
self.bot = bot\
\
@commands.command()\
async def covidmap(self, ctx):\
"""Send an embedded map of current COVID-19 wastewater data."""\
\
# Fetch the data from the CDC NWSS API (replace URL as needed)\
data_url = "https://data.cdc.gov/resource/g653-rqe2.json"\
response = requests.get(data_url)\
\
if response.status_code == 200:\
data = response.json()\
\
# Extract the coordinates and case levels\
latitudes = [float(item['latitude']) for item in data if 'latitude' in item]\
longitudes = [float(item['longitude']) for item in data if 'longitude' in item]\
viral_levels = [item.get('sars_cov_2_virus_normalized_concentration', 0) for item in data]\
\
# Load base map of the US\
world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))\
us = world[world.name == "United States"]\
\
# Plot the map\
fig, ax = plt.subplots(figsize=(10, 8))\
us.plot(ax=ax, color='lightgray', edgecolor='black')\
\
# Plot data points (wastewater sites) on the map\
ax.scatter(longitudes, latitudes, s=20, c=viral_levels, cmap='Reds', alpha=0.6)\
plt.title("COVID-19 Wastewater Surveillance in the US (Real Data)")\
\
# Save the map to a BytesIO object\
map_image = io.BytesIO()\
plt.savefig(map_image, format='png')\
map_image.seek(0)\
\
# Create an embed and attach the image\
embed = discord.Embed(\
title="COVID-19 Wastewater Surveillance Data",\
description="Current COVID-19 levels from wastewater monitoring.",\
color=0x3498db\
)\
embed.set_image(url="attachment://covid_map.png")\
embed.set_footer(text="Source: CDC NWSS")\
\
await ctx.send(embed=embed, file=discord.File(map_image, 'covid_map.png'))\
\
else:\
await ctx.send("Could not retrieve data from CDC.")\
\
async def setup(bot):\
bot.add_cog(COVIDWastewaterMap(bot))}
10 changes: 10 additions & 0 deletions COVIDwastewatermap/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{\rtf1\ansi\ansicpg1252\cocoartf2639
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 HelveticaNeue;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;}
{\*\expandedcolortbl;;\cssrgb\c0\c0\c0;}
\margl1440\margr1440\vieww11520\viewh8400\viewkind0
\deftab720
\pard\pardeftab720\partightenfactor0

\f0\fs32 \cf0 \expnd0\expndtw0\kerning0
\outl0\strokewidth0 \strokec2 geopandas matplotlib}
19 changes: 19 additions & 0 deletions ModContact/ModContact.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from discord.ext import commands

class ModContact(commands.Cog):
def __init__(self, bot):
self.bot = bot

# Set the bot's status to let people know they can DM it to contact the mods
@commands.Cog.listener()
async def on_ready(self):
activity = discord.Activity(name="DM me to contact the mods", type=discord.ActivityType.listening)
await self.bot.change_presence(status=discord.Status.online, activity=activity)

@commands.command()
async def join(self, ctx, thread_id: int):
if ctx.message.thread_id is not None:
await ctx.message.channel.join_thread(thread_id)

async def setup(bot):
await bot.add_cog(ModContact(bot))
39 changes: 38 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,39 @@
# DiamodPlugins
all plugins used for diamod

Custom plugins for [Diamod](https://github.com/DiabeticTurtle/modmail) aka [ModMail](https://github.com/kyb3r/modmail).

Also check out the plugin wiki [here](https://github.com/kyb3r/modmail/wiki/Plugins).

## How to install

`?plugin add DiabeticTurtle/DiamodPlugins/<plugin>@main`

## List of plugins

| Name | Description |
| ---------------| ----------------------------------------------------------------------------------------------------------------------------------------------------|
| Audit | Audit log plugin modified version from Mee6. |
| Button | A button game to test Discord buttons. |
| Trivia | Play trivia with friends on your server. This is a modified version of `cogs trivia` of [Red-DiscordBot](https://github.com/Cog-Creators/Red-DiscordBot). I just made it compatible with Modmail bot. Any credits must go to the original developer. You can find the source [here](https://github.com/Cog-Creators/Red-DiscordBot/tree/V3/develop/redbot/cogs/trivia). |
| Invites | Checks which invite is used when someone joins the server, and the log embed will be posted in the designated channel. |
| Role Manager | Manage roles on your server. This plugin includes Auto Role, Mass Roling, Reaction Roles, and Targeter (a tool to search members that match the given args). This plugin is a combination and modified version of `roleutils` cog made by [PhenoM4n4n](https://github.com/phenom4n4n), and `targeter` cog made by [NeuroAssassin](https://github.com/NeuroAssassin). |
| Embed Manager | Manage, post, edit, store embeds with this plugin. This plugin is a modified version of `embedutils` cog made by [PhenoM4n4n](https://github.com/phenom4n4n). Any credits must go to the original developer of this cog. Original repository can be found [here](https://github.com/phenom4n4n/phen-cogs/tree/master/embedutils). |
| Sender | Send custom messages & embeds in a specific channel (modified version of Welcomer). |
| Tags | Custom embed commands. |
| Voice | Checks if the user is in a voice channel and adds a voice role. (work in progress) |
| Welcomer | Welcome command to greet new users. |
| ~~Moderation~~ | ~~A modified moderation plugin to manage and moderate your server.~~ |
| stats | Various stat commands. |
| ModContact | A plugin for contacting moderators. |
| artprompts | A plugin related to art prompts. |
| backupdb | Plugin for backing up the server's database. |
| beetify | A plugin to add a Blue circle over a users discord pfp |
| dashboard | A plugin for managing server settings and configurations. |
| logger | A plugin for logs with modmail |
| poll | A plugin for creating and managing polls. |
| reactionrole | A plugin for managing roles via reactions to messages. |
| staff-stats | A plugin for tracking and displaying staff-related statistics. |
| starboard | A plugin for featuring and displaying star-worthy messages. |
| ~~tempmute~~ | ~~A plugin for temporarily muting users.~~ |
| translator | A plugin for translating messages and text. |
| warn | A plugin for issuing warnings to users. |
25 changes: 25 additions & 0 deletions Sender/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Installation
Run this command in Modmail: `plugin add welcomer`

# Permission needed to function
`MANAGE_GUILD` (used to view invites)

# Variables
| Name | Description |
| -------- | ------------------------------------------------------------------------------------------------------ |
| `member` | [Member](https://discordpy.readthedocs.io/en/rewrite/api.html#discord.Member) that joined the server. |
| `guild` | [Guild](https://discordpy.readthedocs.io/en/rewrite/api.html#discord.Guild) that the member joined. |
| `bot` | [ClientUser](https://discordpy.readthedocs.io/en/rewrite/api.html#discord.ClientUser) of the bot. |
| `invite` | [Invite](https://discordpy.readthedocs.io/en/rewrite/api.html#discord.Invite) used to join the server. |

Example: `Welcome {member.mention} to {guild.name}! He used {invite.code} to join the server (invite created by {invite.inviter.name})`

# Embeds
For embeds, you'd have to send the JSON representation of the embed.
1. You can use [this tool](https://leovoel.github.io/embed-visualizer/) to generate JSON representations.
2. Copy the JSON from the left and paste it into [hastebin](https://hasteb.in/). Save it (`Ctrl` + `S` or the save button on the right)
3. Copy the URL and paste it into Discord
4. Your final command would then be `welcomer #general https://hasteb.in/theurl`.

##### If you want to use your own text saver thing instead of hastebin, send the raw URL.
For example: https://hasteb.in/raw/about.md
99 changes: 99 additions & 0 deletions Sender/Sender.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import json

import discord
from box import Box
from discord.ext import commands

from .models import apply_vars, SafeString


class Embeds(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.db = bot.plugin_db.get_partition(self)
self.invite_cache = {}
bot.loop.create_task(self.populate_invite_cache())

async def populate_invite_cache(self):
await self.bot.wait_until_ready()
for g in self.bot.guilds:
self.invite_cache[g.id] = {i for i in await g.invites()}

async def get_used_invite(self, guild):
"""Checks which invite is used in join via the following strategies:
1. Check if invite doesn't exist anymore
2. Check invite uses
"""
update_invite_cache = {i for i in await guild.invites()}

for i in self.invite_cache[guild.id]:
if i in update_invite_cache:
# pass check 1
try:
new_invite = next(inv for inv in update_invite_cache if inv.id == inv.id)
except StopIteration:
continue
else:
if new_invite.uses > i.uses:
return new_invite
return Box(default_box=True, default_box_attr='{unable to get invite}')

def apply_vars_dict(self, member, message, invite):
for k, v in message.items():
if isinstance(v, dict):
message[k] = self.apply_vars_dict(member, v, invite)
elif isinstance(v, str):
message[k] = apply_vars(self, member, v, invite)
elif isinstance(v, list):
message[k] = [self.apply_vars_dict(member, _v, invite) for _v in v]
if k == 'timestamp':
message[k] = v[:-1]
return message

def format_message(self, member, message, invite):
try:
message = json.loads(message)
except json.JSONDecodeError:
# message is not embed
message = apply_vars(self, member, message, invite)
message = {'content': message}
else:
# message is embed
message = self.apply_vars_dict(member, message, invite)

if any(i in message for i in ('embed', 'content')):
message['embed'] = discord.Embed.from_dict(message['embed'])
else:
message = None
return message

@commands.has_permissions(manage_guild=True)
@commands.command()
async def send(self, ctx, channel: discord.TextChannel, *, message):
"""Sends custom embeds, Check [here](https://github.com/fourjr/modmail-plugins/blob/master/welcomer/README.md)
for complex usage.
"""
# Example usage: `welcomer #general Hello {member.name}`
# """
if message.startswith('https://') or message.startswith('http://'):
# message is a URL
if message.startswith('https://hasteb.in/'):
message = 'https://hasteb.in/raw/' + message.split('/')[-1]

async with self.bot.session.get(message) as resp:
message = await resp.text()

formatted_message = self.format_message(ctx.author, message, SafeString('{invite}'))
if formatted_message:
await channel.send(**formatted_message)
await self.db.find_one_and_update(
{'_id': 'config'},
{'$set': {'Embeds': {'channel': str(channel.id), 'message': message}}},
upsert=True
)
await ctx.send(f'Message sent to {channel.mention} ')
else:
await ctx.send('Invalid message syntax.')

def setup(bot):
bot.add_cog(Embeds(bot))
26 changes: 26 additions & 0 deletions Sender/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import string


class SafeFormat(object):
def __init__(self, **kw):
self.__dict = kw

def __getitem__(self, name):
return self.__dict.get(name, SafeString('{%s}' % name))


class SafeString(str):
def __getattr__(self, name):
try:
super().__getattr__(name)
except AttributeError:
return SafeString('%s.%s}' % (self[:-1], name))


def apply_vars(self, member, message, invite):
return string.Formatter().vformat(message, [], SafeFormat(
member=member,
guild=member.guild,
bot=self.bot.user,
invite=invite
))
1 change: 1 addition & 0 deletions Sender/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-box
25 changes: 25 additions & 0 deletions Welcomer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Installation
Run this command in Modmail: `plugin add welcomer`

# Permission needed to function
`MANAGE_GUILD` (used to view invites)

# Variables
| Name | Description |
| -------- | ------------------------------------------------------------------------------------------------------ |
| `member` | [Member](https://discordpy.readthedocs.io/en/rewrite/api.html#discord.Member) that joined the server. |
| `guild` | [Guild](https://discordpy.readthedocs.io/en/rewrite/api.html#discord.Guild) that the member joined. |
| `bot` | [ClientUser](https://discordpy.readthedocs.io/en/rewrite/api.html#discord.ClientUser) of the bot. |
| `invite` | [Invite](https://discordpy.readthedocs.io/en/rewrite/api.html#discord.Invite) used to join the server. |

Example: `Welcome {member.mention} to {guild.name}! He used {invite.code} to join the server (invite created by {invite.inviter.name})`

# Embeds
For embeds, you'd have to send the JSON representation of the embed.
1. You can use [this tool](https://leovoel.github.io/embed-visualizer/) to generate JSON representations.
2. Copy the JSON from the left and paste it into [hastebin](https://hasteb.in/). Save it (`Ctrl` + `S` or the save button on the right)
3. Copy the URL and paste it into Discord
4. Your final command would then be `welcomer #general https://hasteb.in/theurl`.

##### If you want to use your own text saver thing instead of hastebin, send the raw URL.
For example: https://hasteb.in/raw/about.md
Loading