Browse Source

Typo Fixes 2.0

pull/122/head
NCPlayz 6 years ago
parent
commit
020cf21a01
  1. 2
      disco/bot/bot.py
  2. 4
      disco/gateway/events.py
  3. 2
      disco/types/base.py
  4. 4
      disco/types/guild.py
  5. 4
      disco/util/emitter.py
  6. 4
      disco/util/functional.py
  7. 2
      disco/util/logging.py
  8. 2
      disco/util/snowflake.py
  9. 2
      disco/voice.py
  10. 4
      docs/bot_tutorial/building_block_commands.md
  11. 2
      docs/bot_tutorial/building_block_listeners.md
  12. 2
      docs/bot_tutorial/message_embeds.md

2
disco/bot/bot.py

@ -249,7 +249,7 @@ class Bot(LoggingClass):
else:
possible[current] = group
# Now, we want to compute the actual shortest abbreivation out of the
# Now, we want to compute the actual shortest abbreviation out of the
# possible ones
result = {}
for abbrev, group in six.iteritems(possible):

4
disco/gateway/events.py

@ -133,7 +133,7 @@ class Ready(GatewayEvent):
session_id : str
The session ID.
user : :class:`disco.types.user.User`
The user object for the authed account.
The user object for the authenticated account.
guilds : list[:class:`disco.types.guild.Guild`
All guilds this account is a member of. These are shallow guild objects.
private_channels list[:class:`disco.types.channel.Channel`]
@ -256,7 +256,7 @@ class ChannelPinsUpdate(GatewayEvent):
----------
channel_id : snowflake
ID of the channel where pins where updated.
last_pin_timestap : datetime
last_pin_timestamp : datetime
The time the last message was pinned.
"""
channel_id = Field(snowflake)

2
disco/types/base.py

@ -220,7 +220,7 @@ def datetime(data):
except (ValueError, TypeError):
continue
raise ValueError('Failed to conver `{}` to datetime'.format(data))
raise ValueError('Failed to convert `{}` to datetime'.format(data))
def text(obj):

4
disco/types/guild.py

@ -158,7 +158,7 @@ class GuildMember(SlottedModel):
roles : list(snowflake)
Roles this member is part of.
premium_since : datetime
When this user set their nitro boost to this server.
When this user set their Nitro boost to this server.
"""
user = Field(User)
guild_id = Field(snowflake)
@ -316,7 +316,7 @@ class Guild(SlottedModel, Permissible):
premium_tier : int
Guild's premium tier.
premium_subscription_count: int
The amount of users using their nitro boost on this guild.
The amount of users using their Nitro boost on this guild.
"""
id = Field(snowflake)
owner_id = Field(snowflake)

4
disco/util/emitter.py

@ -16,12 +16,12 @@ class Priority(object):
# with the one difference being it executes after all the BEFORE listeners.
AFTER = 2
# SEQUENTIAL guarentees that all events your handler recieves will be ordered
# SEQUENTIAL guarantees that all events your handler receives will be ordered
# when looked at in isolation. SEQUENTIAL handlers will not block other handlers,
# but do use a queue internally and thus can fall behind.
SEQUENTIAL = 3
# NONE provides no guarentees around the ordering or execution of events, sans
# NONE provides no guarantees around the ordering or execution of events, sans
# that BEFORE handlers will always complete before any NONE handlers are called.
NONE = 4

4
disco/util/functional.py

@ -7,8 +7,8 @@ def take(seq, count):
"""
Take count many elements from a sequence or generator.
Args
----
Parameters
----------
seq : sequence or generator
The sequence to take elements from.
count : int

2
disco/util/logging.py

@ -21,7 +21,7 @@ def setup_logging(**kwargs):
# Pass through our basic configuration
logging.basicConfig(**kwargs)
# Override some noisey loggers
# Override some noisy loggers
for logger, level in LEVEL_OVERRIDES.items():
logging.getLogger(logger).setLevel(level)

2
disco/util/snowflake.py

@ -41,7 +41,7 @@ def to_snowflake(i):
elif hasattr(i, 'id'):
return i.id
raise Exception('{} ({}) is not convertable to a snowflake'.format(type(i), i))
raise Exception('{} ({}) is not convertible to a snowflake'.format(type(i), i))
def calculate_shard(shard_count, guild_id):

2
disco/voice.py

@ -159,7 +159,7 @@ class VoiceConnection(object):
def _event_reader(self, fd):
if not make_nonblocking(fd):
raise Exception('failed to make event pipe nonblocking')
raise Exception('failed to make event pipe non-blocking')
buff = ""
while True:

4
docs/bot_tutorial/building_block_commands.md

@ -6,7 +6,7 @@ In the case of these examples, when you send `!help` or `!info` the bot will rep
## Basic commands
Creating commands in Disco is really easy because of the [Plugins](https://b1naryth1ef.github.io/disco/bot_tutorial/building_block_plugins.html) that are a core fundamential of Disco. For more info on them, read back in the [Plugins](https://b1naryth1ef.github.io/disco/bot_tutorial/building_block_plugins.html) section of this tutorial. Creating a basic command is done as follows:
Creating commands in Disco is really easy because of the [Plugins](https://b1naryth1ef.github.io/disco/bot_tutorial/building_block_plugins.html) that are a core fundamental of Disco. For more info on them, read back in the [Plugins](https://b1naryth1ef.github.io/disco/bot_tutorial/building_block_plugins.html) section of this tutorial. Creating a basic command is done as follows:
First, create a Plugin class:
```py
class myPlugin(Plugin):
@ -48,7 +48,7 @@ Here, we added multiple arguments to our command. Namely, number a and number b,
Lets create a tag system, that can either store a tag if you'd use it like this: `!tag name value` or retrieve a tag if you'd use it like this: `!tag name`
We'll need 2 arguments. A name argument that's required, and an optional value argument. Inside the command we'll check if a `value` is provided. If there is, we'll store the tag. Otherwise, we'll try to retrieve the previously set value for that tag and return it.
For the sake of this example, we'll asume that the `tags` dict gets stored somewhere so it doesn't get removed after a restart.
For the sake of this example, we'll assume that the `tags` dict gets stored somewhere so it doesn't get removed after a restart.
```py
tags = {}

2
docs/bot_tutorial/building_block_listeners.md

@ -12,7 +12,7 @@ def on_message_create(self, event):
self.log.debug('Got message: %s', event.message)
```
Ok, but what if we want to make a listener which welcomes new users to our server? Well thats also easy:
Ok, but what if we want to make a listener which welcomes new users to our server? Well that's also easy:
```py
@Plugin.listen('GuildMemberAdd')

2
docs/bot_tutorial/message_embeds.md

@ -46,7 +46,7 @@ embed.set_footer(text='Disco Message Embeds tutorial')
embed.color = '10038562' #This can be any color, but I chose a nice dark red tint
```
Once your embed is finshed, you can send it using the `channel.send_message()` message or the `event.msg.reply()` function.
Once your embed is finished, you can send it using the `channel.send_message()` message or the `event.msg.reply()` function.
With `channel.send_message()`:
```py
self.state.channels.get(<ChannelID>).send_message('[optional text]', embed=embed)

Loading…
Cancel
Save