-
Notifications
You must be signed in to change notification settings - Fork 0
/
DisSenderV1.py
153 lines (98 loc) · 5.19 KB
/
DisSenderV1.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
import dearpygui.dearpygui as dpg
import discord
from dearpygui.dearpygui import add_font
import json
import requests
dpg.create_context()
with dpg.font_registry():
with dpg.font(f'C:\\Windows\\Fonts\\Calibri.ttf', 13, default_font=True, id="Default font"):
dpg.add_font_range_hint(dpg.mvFontRangeHint_Cyrillic)
dpg.bind_font("Default font")
def test(sender):
slide = dpg.get_value(how)
for i in range(int(slide)):
id = dpg.get_value(ids)
token1 = dpg.get_value(token)
URL = f"https://discord.com/api/v9/channels/{id}/messages"
value = dpg.get_value(text)
r = requests.post(URL,data={"content": value},headers={"Authorization":f"Bot {token1}"})
id = dpg.get_value(ids)
dpg.get_value(token)
URL = f"https://discord.com/api/v9/channels/{id}/messages"
value = dpg.get_value(text)
r = requests.post(URL,data={"content": value},headers={"Authorization":f"Bot {token1}"})
def remove(sender):
id2 = dpg.get_value(ids1)
token2 = dpg.get_value(token)
URL2 = f"https://discord.com/api/v9/channels/{id2}"
r2 = requests.delete(URL2,headers={"Authorization":f"Bot {token2}"})
def add(sender):
slide = dpg.get_value(chanhow)
for i in range(int(slide)):
guil = dpg.get_value(idchan)
token3 = dpg.get_value(token)
addURL = f"https://discord.com/api/v9/guilds/{guil}/channels"
name1 = dpg.get_value(addchannel)
r3 = requests.post(addURL,json={"name": name1,"permission_overwrites" : [],"type": 0},headers={"Authorization":f"Bot {token3}"})
guil = dpg.get_value(idchan)
addURL = f"https://discord.com/api/v9/guilds/{guil}/channels"
token3 = dpg.get_value(token)
name1 = dpg.get_value(addchannel)
r3 = requests.post(addURL,json={"name": name1,"permission_overwrites" : [],"type": 0},headers={"Authorization":f"Bot {token3}"})
def kick(sender):
skickid = dpg.get_value(kickmem)
memberid1 = dpg.get_value(memberid)
token4 = dpg.get_value(token)
kickURL = f"https://discord.com/api/v9/guilds/{skickid}/members/{memberid1}"
kick = requests.delete(kickURL,headers={"Authorization":f"Bot {token4}"})
def servername(sender):
servidname = dpg.get_value(servname)
newname = dpg.get_value(name)
token5 = dpg.get_value(token)
nameURL = f"https://discord.com/api/v9/guilds/{servidname}"
patchname = requests.patch(nameURL,json={"name": newname},headers={"Authorization":f"Bot {token5}"})
print(patchname)
with dpg.window(label="DiscordSender", tag = "Primary Window"):
token = dpg.add_input_text(label="Bot Token")
dpg.add_text("Server Message Spam")
ids = dpg.add_input_text(label="channel id for text")
how = dpg.add_slider_int(label = "how message?")
text = dpg.add_input_text(label="your text")
dpg.add_button(label="send", callback = test)
dpg.add_text("Server Channel Remove")
ids1 = dpg.add_input_text(label="channel id for remove")
dpg.add_button(label="remove channel", callback = remove)
dpg.add_text("Server Channel Create")
idchan = dpg.add_input_text(label="server id for create channel")
addchannel = dpg.add_input_text(label="name channel for add")
chanhow = dpg.add_slider_int(label = "how channels?")
dpg.add_button(label="Add channel", callback=add)
dpg.add_text("Member kick")
kickmem = dpg.add_input_text(label="server id for kick")
memberid = dpg.add_input_text(label="member id for kick")
dpg.add_button(label="Kick member", callback = kick)
dpg.add_text("Server Set Name")
servname = dpg.add_input_text(label="server id for set name")
name = dpg.add_input_text(label="new server name!")
dpg.add_button(label="set name", callback = servername)
with dpg.theme() as global_theme:
with dpg.theme_component(dpg.mvAll):
dpg.add_theme_color(dpg.mvThemeCol_WindowBg, (51, 54, 61), category=dpg.mvThemeCat_Core)
dpg.add_theme_color(dpg.mvThemeCol_Button, (87, 101, 242), category=dpg.mvThemeCat_Core)
dpg.add_theme_color(dpg.mvThemeCol_SliderGrab, (104, 104, 104), category=dpg.mvThemeCat_Core)
dpg.add_theme_color(dpg.mvThemeCol_FrameBgHovered, (64, 68, 76), category=dpg.mvThemeCat_Core)
dpg.add_theme_color(dpg.mvThemeCol_FrameBg, (62, 66, 74), category=dpg.mvThemeCat_Core)
dpg.add_theme_color(dpg.mvThemeCol_ButtonHovered, (64, 68, 76), category=dpg.mvThemeCat_Core)
dpg.add_theme_color(dpg.mvThemeCol_ButtonActive, (44, 44, 44), category=dpg.mvThemeCat_Core)
dpg.add_theme_color(dpg.mvThemeCol_SliderGrabActive, (44, 44, 44), category=dpg.mvThemeCat_Core)
dpg.add_theme_style(dpg.mvStyleVar_FrameRounding, 5, category=dpg.mvThemeCat_Core)
dpg.add_theme_style(dpg.mvStyleVar_GrabRounding, 20, category=dpg.mvThemeCat_Core)
dpg.bind_theme(global_theme)
dpg.create_viewport(title='DiscordSender', width=800, height=650)
dpg.set_viewport_small_icon("discordic.ico")
dpg.set_viewport_large_icon("discordic.ico")
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.set_primary_window("Primary Window", True)
dpg.start_dearpygui()
dpg.destroy_context()